I have a certain function I added in CvPlayerAI that is called by AI_getAttitudeVal() and, in effect, does the following:
If player A has fulfilled certain conditions toward player B, and player C is furious toward player B, then player A suffers an attitude penalty toward player C. It is similar to "You have traded with our worst enemies".
My problem is that I used this code:
but when AI_getAttitude() is called, it in turn calls AI_getAttitudeVal(), which calls the function I added, which then calls AI_getAttitude() again, which then calls AI_getAttitudeVal() again, and it continues to repeat itself until I get a stack overflow error.
Any ideas on how to fix this?
If player A has fulfilled certain conditions toward player B, and player C is furious toward player B, then player A suffers an attitude penalty toward player C. It is similar to "You have traded with our worst enemies".
My problem is that I used this code:
Code:
if (eEnemy != getID())
{
if (AI_getAttitude(eEnemy) == ATTITUDE_FURIOUS)
{
...
}
}
but when AI_getAttitude() is called, it in turn calls AI_getAttitudeVal(), which calls the function I added, which then calls AI_getAttitude() again, which then calls AI_getAttitudeVal() again, and it continues to repeat itself until I get a stack overflow error.
Any ideas on how to fix this?