Thalassicus
Bytes and Nibblers
I think I finally found what causes weird citystate influence gains in the late game. It should be fixed in v159.
In the AI purchase algorithm, whenever any AI unlocks the tech for the United Nations wonder, AIs start directing gold to citystates to prevent diplomatic victory. This is done with:
ChangeMinorCivFriendshipWithMajor(playerID, influence)
However, I forgot to initialize playerID. Since lua does not require variables be initialized before use (a horrible design decision that causes so many bugs!)... it was passing a "nil" to the function, which apparently gives influence to the human player. So every time the AI attempted to purchase influence to prevent diplomatic victory, the human got the influence the AI paid for.
In the AI purchase algorithm, whenever any AI unlocks the tech for the United Nations wonder, AIs start directing gold to citystates to prevent diplomatic victory. This is done with:
ChangeMinorCivFriendshipWithMajor(playerID, influence)
However, I forgot to initialize playerID. Since lua does not require variables be initialized before use (a horrible design decision that causes so many bugs!)... it was passing a "nil" to the function, which apparently gives influence to the human player. So every time the AI attempted to purchase influence to prevent diplomatic victory, the human got the influence the AI paid for.
