"Houston, we have a problem!"
So, it compiles, it links, it works!! I've played a lot of games with my modded dll, and everything seemed allright.
Now, here comes a problem. A BIG problem, it seems. And I'm quite sure of that.
I use BTS 3.17.
In the method CvPlayerAI.AI_bonusTrade, there's this line
Code:
eAttitude = AI_getAttitude(ePlayer);
This class has two methods with this name
Code:
AttitudeTypes CvPlayerAI::AI_getAttitude(int iAttitudeVal)
AttitudeTypes CvPlayerAI::AI_getAttitude(PlayerTypes ePlayer, bool bForced)
The call is obviously intended to execute the second method (with the default value of bForced to false). I've placed a couple of traces in the code (displaying messages) and I've noticed that instead it calls the FIRST method, giving a value of ePlayer=0 (the active player). So, instead of calculating the attitude against player 0, it converts the attitude value 0 in the corresponding attitudetypes, which is ATTITUDE_CAUTIOUS. As a result, every call always returns CAUTIOUS, regardless of the actual attitude.
I've never noticed this malfunction; the game seems to work correctly.
I could simply correct this (by adding a second parameter in the method call), but I'm afraid this can affect other parts of the code.
Is this a problem introduced with the 3.17 patch? Does anyone else have the same problem? Maybe, there could be a compiler option to set.