Modding Bug

tchristensen

Emperor
Joined
Jul 21, 2010
Messages
1,241
Location
Grand Rapids, Mi
I recently downloaded the cool mod called StrategicRivers and have made some very minor XML changes.

Recently I started getting this error:

Assert Failed

File: CvCity.cpp
Line: 10252
Expression: eIndex >= 0
Message: eIndex expected to be >= 0

I can continue the game if I alt-tab to the desktop and tell it to Always Ignore the error but would like to fix it.

I am thinking it has something to do with a unit and its promotion, but as I said I did so very little XML changes I cannot fathom what might be the issue?

Any help?

Troy
 
You almost certainly have a bad value somewhere, a THING_SOMETHING entry that does not exist (possibly due to a typo). Using one that does not exist will typically cause it to use a -1, which results in that sort of error when it tries to look up the thing in question. This can happen via the Python code too, so any changes to that or to anything used by it are also suspects.

Open the CvCity.cpp for the mod and see what it is trying to do around line 10252. That line should be an assert that has some text in it that says "eIndex expected to be >= 0" (which is very common, it appears all over the place - they really should have made all the messages unique instead of repeating info that the reported expression line already tells you), if it doesn't then the file you are looking at is not the one used to build the DLL you are using (which makes things harder to debug). The name of the function that line is in should be enough to tell you what kind of thing has gone awry. Examine anything you added that would have a reference to something of that sort to make sure all such references are correct. If you removed anything relating to that type of thing, search all the .xml and .py files for references to the things that were removed and remove (or change) all of those references too.
 
Thanks. Looking at the python code it appears to relate to be unit experience. I changed nothing in the python code, but did make some changes to units and to free promotions in the traits.


int CvCity::getUnitCombatFreeExperience(UnitCombatTypes eIndex) const
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumUnitCombatInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()");
return m_paiUnitCombatFreeExperience[eIndex];
}
 
Back
Top Bottom