civfanatics / CQUI_Community-Edition

Civilization 6 mod - UI enhancements, reduce clicks and manage your empire faster!
MIT License
149 stars 28 forks source link

Opponent's Secret Society is always known #308

Open Infixo opened 3 years ago

Infixo commented 3 years ago

On the DiploScreen, there is information about opponent's Secret Society. There is a bug in the Lua code that causes it always to be known, even in the situation when we actually have not yet discovered it.

The bug is here, file DiplomacyActionView_SecretSocietyRow.lua. If the opponent has the SS, then there is a check if we are aware of it. However, wrong object is used and the game actually if the opponent is aware of if, which ofc is always true.

if eSecretSociety ~= -1 then
    local pLocalPlayer:table = Players[Game.GetLocalPlayer()];
    local pLocalPlayerGovs:table = pSelectedPlayer:GetGovernors(); -- !!! It should be pLocalPlayer:GetGovernors() !!!

    if pLocalPlayerGovs:IsAwareOfSecretSociety(eSecretSociety) then
        -- Known Secret Society