probably same bug (warlords 1/30):
Assert Failed
File: .\CvGlobals.cpp
Line: 1236
Expression: eUnitNum > -1
Message:
no assert info before
can't publish save game, because this is happened in our TR devel version (merged with BetterAI 1/30 (ie rev. 338))
EDIT:
when setting more log messages into code, i found that game crashed in CvUnitAI::AI_update method
which is called at line 203 in CvSelectionGroupAI::AI_update
here is code with my debug messages (from CvSelectionGroupAI.cpp):
when crash occurred, game never pass pHeadUnit->AI_update()
last message in log file is:
selgroupAI::AI_Update after resetPath, before pHeadUnit->AI_update()
i hope this will help you find a problem
meanwhile i start debugging CvUnitAI::AI_update(), if i found something new, i will update this post
EDIT2:
more tests in AI_update pointed to AI_exploreMove()
EDIT3:
AI_exploreMove -> AI_travelToUpgradeCity() , there never pass through getPathEndTurnPlot() function
EDIT4, last:
getPathEndTurnPlot generate CTD, because there is no path generated! (pNode is NULL inside this function)
problem is in AI_travelToUpgradeCity()
Code:
// can we path to the upgrade city?
int iUpgradeCityPathTurns;
[B] bool bCanPathToUpgradeCity = generatePath(pUpgradeCity->plot(), 0, true, &iUpgradeCityPathTurns);[/B]
CvPlot* pThisTurnPlot = getPathEndTurnPlot();
// if we close to upgrade city, head there
if (bCanPathToUpgradeCity && (pClosestCity == pUpgradeCity || iUpgradeCityPathTurns < 4))
{
getGroup()->pushMission(MISSION_MOVE_TO, pThisTurnPlot->getX_INLINE(), pThisTurnPlot->getY_INLINE());
return true;
}
in my game, generatePath return false, because there is no route to own city - exploring unit (in my case it is warrior) is somewhere in land, but there is other civ which is blocked his way to home
suggested solution:
Code:
// can we path to the upgrade city?
int iUpgradeCityPathTurns;
bool bCanPathToUpgradeCity = generatePath(pUpgradeCity->plot(), 0, true, &iUpgradeCityPathTurns);
// CvPlot* pThisTurnPlot = getPathEndTurnPlot(); //old code
// New code
[I] CvPlot* pThisTurnPlot;
if(bCanPathToUpgradeCity)
{
pThisTurnPlot = getPathEndTurnPlot();
}
[/I] // end of new code
// if we close to upgrade city, head there
(heh..it look like my previous bug is not linked to this one

- i will try fix this and then re-run assert code to check this assert)
ok, when fixed this as descrbed above, game running fine (pass through this problematic point), now i will recompile with assert support and re-run to check assert message from start
Mexico