Well, my game was stuck with a bugged Delayed Response so I took a bit of time to attempt to figure this one out. Now sure if I did as they bug went away on its own in my saving and reloading, but I forced some Diplomacy Events and produced the
FAssertMsg(ePlayer < MAX_PLAYERS, "Player is not assigned a valid value"); that kept accuring during my play sessions. This code either came from python or the exe as there was no stack code with it.
I studied the code you added Night and so I added this code to the getPlayer funciton...
Code:
static CvPlayerAI& getPlayer(PlayerTypes ePlayer)
{
int iPlayer = ePlayer;
if (iPlayer > DELAYED_RESPONSE_BITS_NEGATIVE_OFFSET)
{
//bRemove = iData1 | DELAYED_RESPONSE_BITS_FROM_QUEUE;
iPlayer &= ~DELAYED_RESPONSE_BITS_FROM_QUEUE;
if (iPlayer & DELAYED_RESPONSE_BITS_IS_NEGATIVE)
{
iPlayer &= ~DELAYED_RESPONSE_BITS_IS_NEGATIVE;
iPlayer -= DELAYED_RESPONSE_BITS_NEGATIVE_OFFSET;
}
ePlayer = (PlayerTypes)iPlayer;
}
FAssertMsg(ePlayer >= 0, "Player is not assigned a valid value");
FAssertMsg(ePlayer < MAX_PLAYERS, "Player is not assigned a valid value");
return m_aPlayers[ePlayer];
}
This seemed to fixed the Failed assert I was getting, now if it fixed the locked up Delayed Response bug, I do not know.
What was happening it seems was that Python or the exe was doing a getData() of the Diplomacy infos and which was returning the value of DELAYED_RESPONSE_BITS_FROM_QUEUE thus casing the FAssert.
My question is, how is it that when the python is called to build a Diplomacy screen it built it correctly. Like the Diplomacy to join a war would send the Python a BestTeam value stored in getData(), but you changed the getData value to DELAYED_RESPONSE_BITS_FROM_QUEUE, so how does it use the correct value that time and not up where it does a getPlayer()? And also, it is using a getPlayer function when the value sent is a TeamType. Although it works still because the value of the PlayerType and TeamType are the same in this instance.
Also, all but one of the times that the Delayed Response assigns a value to getData it uses Teamtype, the one other time it uses a city ID, but I checked this and it seems to work fine.