phungus420
Deity
- Joined
- Mar 1, 2003
- Messages
- 6,296
No surprise, but no dice, Assert never trips, and crash still occurs. I tried adding this bit of code:
Doing so causes an access violation error crash in "Vector" (making the min bound 0 also screws things up horribly, as I forgot that -1 would be used for all the players that hadn't been created yet). Trying to backtrack this function, you find it's only really used once in CvPlayer:
But the function CvPlayer::getCivilizationType() is called too many times to count to try to backtrack it further.
Any ideas why that code I added would cause it to crash in vector, and never trip the assert message?
Code:
CivilizationTypes CvInitCore::getCiv(PlayerTypes eID) const
{
if (!m_aeCiv)
{
FAssertMsg(false, "something odd is going on");
return NO_CIVILIZATION;
}
FASSERT_BOUNDS(0, MAX_PLAYERS, eID, "CvInitCore::getCiv");
if ( checkBounds(eID, 0, MAX_PLAYERS) )
{
[B]FASSERT_BOUNDS(-1, GC.getNumCivilizationInfos(), m_aeCiv[eID], "CvInitCore::getCiv, CivilizationType out of bounds");
if ( checkBounds(m_aeCiv[eID], -1, GC.getNumCivilizationInfos()) )
{
return m_aeCiv[eID];
}
else
{
return NO_CIVILIZATION;
}[/B]
}
else
{
return NO_CIVILIZATION;
}
}
Doing so causes an access violation error crash in "Vector" (making the min bound 0 also screws things up horribly, as I forgot that -1 would be used for all the players that hadn't been created yet). Trying to backtrack this function, you find it's only really used once in CvPlayer:
Code:
CivilizationTypes CvPlayer::getCivilizationType() const
{
return GC.getInitCore().getCiv(getID());
}
Any ideas why that code I added would cause it to crash in vector, and never trip the assert message?