I've compiled a debug DLL for 3.23 with Inhabited Planets included. That makes testing for crashes imprecise... but I thought I'd share my results anyway.
I get a probably unrelated assert failure when starting a game:
Code:
Assert Failed
File: CvPlot.cpp
Line: 5224
Expression: m_pFeatureSymbol != NULL
Message: [Jason] No feature symbol.
----------------------------------------------------------
It occurs on some other lines in CvPlot.cpp as well, around the same area. But it doesn't seem to be a problem.
Then the game loads. I begin my first turn (as the First Federation)...
Then I receive this message when going to the next turn:
Code:
Assert Failed
File: CvCity.cpp
Line: 1013
Expression: iCount == getBaseYieldRate((YieldTypes)iI)
Message:
----------------------------------------------------------
This one I suspect is related to the way Star Trek overrides city yields in Python. No crashes; the game plays on.
(While this is completely unrelated, I just noticed that when in the "What would you like to build in this Star System" popup, my Deep Space Probe's unique button graphic displays correctly, but when I click "Examine Star System", it appears like the normal Scout. Probably a FF engine bug, one that I'll look into for Final Frontier Plus, but I thought I'd mention it.)
Then, on turn 32... I get an unhandled exception. (Which would be a CTD had I not been running the game attached to VC++).
The problem appears to be related to cloak code. The exception is occuring when this function (CvUnit.cpp, line 8615):
Code:
bool CvUnit::checkCloakedPlot(CvPlot* pPlot, TeamTypes eTeam) const
{
for (int i = 0; i < pPlot->getNumUnits(); i++)
{
CvUnit* pUnit = pPlot->getUnitByIndex(i);
if(pUnit->m_iSeeCloakedCount > 0)
{
PlayerTypes ePlayer = pUnit->getOwner();
if(GET_PLAYER(ePlayer).getTeam() == eTeam)
{
return true;
}
}
}
return false;
}
Is trying to get the number of units on a plot.
That points to this function (CvPlot.cpp, line 8029):
Code:
int CvPlot::getNumUnits() const
{
return m_units.getLength();
}
Which pulls up this function in LinkedList.h, line 65:
Code:
int getLength() const
{
return m_iLength;
}
The nature of the errors in the debugger suggest that the checkCloakedPlot function is referencing an invalid plot (as some of the plot data "cannot be evaluated"). So the actual problem may be in
this function (CvUnit.cpp line 8357, which is the highlighted line):
Code:
bool CvUnit::isInvisible(TeamTypes eTeam, bool bDebug, bool bCheckCargo) const
{
if (bDebug && GC.getGameINLINE().isDebugMode())
{
return false;
}
if (getTeam() == eTeam)
{
return false;
}
if (alwaysInvisible())
{
return true;
}
if (bCheckCargo && isCargo())
{
return true;
}
bool bUndetected = true;
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 3; j++)
{
[COLOR="Red"]if(checkCloakedPlot(GC.getMap().plot((plot()->getX() - 1 + i),(plot()->getY() - 1 + j)), eTeam))[/COLOR]
{
bUndetected = false;
}
}
}
if (m_iCloakedCount > 0)
{
if(bUndetected)
{
return true;
}
}
//Star Trek - promotions
if (!(getNumInvisibleTypes() > 0))
{
return false;
}
else
{
if (isInvisibleAtPlot(plot(), eTeam))
{
return true;
}
}
return false;
}
Anyway, I then stop debugging and the CTD finally happens.