Assert Failed

vincentz

Programmer
Joined
Feb 4, 2009
Messages
3,614
Location
Denmark
I have a bunch of Assert Failed when debugging, and while they dont seem to cause any trouble, they do kind of bother me, and I would prefer to atleast understand them before turning them off.

They will be added to this thread as they come up in my game.

The first one: eBuilding = 139 and eBuildingClass = 121.
Frequency is very high and starts already after map gen.

SOLVED

Assert Failed
File: .\.\CvPlayer.cpp
Line: 5387
Expression: GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) == eBuilding



PHP:
bool CvPlayer::canConstruct(BuildingTypes eBuilding, bool bContinue, bool bTestVisible, bool bIgnoreCost) const
{
    BuildingClassTypes eBuildingClass;
    int iI;
    CvTeamAI& currentTeam = GET_TEAM(getTeam());

    eBuildingClass = ((BuildingClassTypes)(GC.getBuildingInfo(eBuilding).getBuildingClassType()));

    FAssert(GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) == eBuilding);
    if (GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) != eBuilding)
    {
        return false;
    }

From what I can read it says te
 
Last edited:
I highly recommend that you put in the effort of fixing the assertion as soon as you encounter it, at least that's preferable to having the game-state getting silently corrupted, the AI being confused or straight up triggering an access violation at an inopportune time...
 
I highly recommend that you put in the effort of fixing the assertion as soon as you encounter it, at least that's preferable to having the game-state getting silently corrupted, the AI being confused or straight up triggering an access violation at an inopportune time...
I agree, though some of them I wasnt able to fix/find out what the were about, others were simply because I made a lot of big changes to the gamerules, f.ex I have negative movement points which triggers some assertions. The defender withdrawal mod also triggers one.
Most of the ones I've encountered were quite simple when I dug a little bit into them though, but the first one always had me bugged, and it wasnt until I added some code to see the names of the building/buildingclass that I found the problem.
 
Back
Top Bottom