Thanks again for the help.
Unfortunately my hunch wasn't right, and adding those asserts did not catch anything new. For more specific information, this is the first place where I'm made aware something has gone wrong:
Code:
CvCivilizationInfo& CvGlobals::getCivilizationInfo(CivilizationTypes eCivilizationNum)
{
[B]FAssert(eCivilizationNum > -1);[/B]
FAssert(eCivilizationNum < GC.getNumCivilizationInfos());
return *(m_paCivilizationInfo[eCivilizationNum]);
}
bolded assert that fires. If start stepping through the debugger the function that trips this is:
Code:
const wchar* CvPlayer::getCivilizationDescription(uint uiForm) const
{
/************************************************************************************************/
/* REVOLUTION_MOD 01/01/08 jdog5000 */
/* */
/* dynamic civ names */
/************************************************************************************************/
/*
if (GC.getInitCore().getCivDescription(getID(), uiForm).empty())
{
return GC.getCivilizationInfo(getCivilizationType()).getDescription(uiForm);
}
else
{
return GC.getInitCore().getCivDescription(getID(), uiForm);
}
*/
if( !(m_szCivDesc.empty()) )
{
return m_szCivDesc;
}
[B]else if (GC.getInitCore().getCivDescription(getID(), uiForm).empty())[/B]
{
return GC.getCivilizationInfo(getCivilizationType()).getDescription(uiForm);
}
else
{
return GC.getInitCore().getCivDescription(getID(), uiForm);
}
/************************************************************************************************/
/* REVOLUTION_MOD END */
/************************************************************************************************/
}
Bolded the line of code that the debugger steps directly into after the assert.
Now here is what I know about the bug: It only pops up if you change player or go into AI autoplay, if you just play the game, this does not occur. If you ever changed player or went into AIAutoplay this assert will end up occuring, even if you're playing normal. (strange huh?). This assert happens when a minor civ is supposed to settle, ie it will happen if you're plaiying start as minors and a civ gets writing, and/or it'll fire when you have Barb Civs on, and the barb civ attempts to settle down into a full civ from a minor civ (the bug also causes the minor civ settling to fail, and the game can be played on, but the civs stay minors).
Because of the above behavior I figured the bug must be in the settleMinorCiv function, but I cannot find any issues with it. I also went through the BarbarianCiv.py and MinorCiv.py files and added a bunch of checks to ensure the Player is alive and their id# is between 0 and MAX_PLAYERs, but the same bug continues to occur. Because adding your code that ensures the call is being made on a real player, and the fact that adding the aforementioned code to ensure a valid ID number in the relevant functions in the Revolution python files, I'm pretty sure an invalid ID number is not the cause.
I'm including a RevDCM save (current SVN version) where the bug occurs within a couple turns, I would post the setterMinorCiv code, but it's too many characters long for a post, so I'm including my modified BarbarianCiv.py file with the added player ID number validation checks, for the original see the RevDCM SVN. If you (or anyone else) has any ideas of what else to check I'll work further on debugging this, unfortunately right now I have no idea what I should work on next, and also don't even have a hunch for what is causing the problem, so I'm just stumped with no direction to go.