Why sometimes GameInfoTypes["CIVILIZATION_MY_SPONSOR"] is nil?

g02703

Chieftain
Joined
Apr 2, 2016
Messages
33
On certain GameEvents, I want to check whether the player's civilization is my mod-sponsor in order to give that player (whether it's me or if it's AI) some bonuses, so I use this code:

if GameInfoTypes["CIVILIZATION_MY_SPONSOR"] == player:GetCivilizationType() then
-- give bonus here
end

Sometimes, GameInfoTypes["CIVILIZATION_MY_SPONSOR"] is nil - I don't know why. So far, it happens when I first load CivBE and set up a game where I pick that sponsor as me. Printing to FireTuner shows nil.

The funny thing is, I will need to quit that current game to Main Menu, set up a game picking that same sponsor again, and voila - GameInfoTypes["CIVILIZATION_MY_SPONSOR"] is no longer nil, but the expected value.

What could I be doing wrong?
 
It's the same bug that makes action bars not show up properly. Just return to the mod menu after activating mods and activate them a second time (don't have to be the same mods, you can just load some empty dummy-mod to speed up the process), then that stuff should not return nil anymore.
 
Back
Top Bottom