Surprise: Help needed in debugging DLL

Alrik2002

Warlord
Joined
May 24, 2012
Messages
214
Location
Berlin, Germany
Hi,

I started to rebuild my first SDK. For the beginning I started with a non modified version of 50Civs Better BAT AI - DLL.

The build worked fine without any errors. The I started the game with the debug-dll and I get some errors:


Code:
Assert Failed

File:  CvXMLLoadUtilitySet.cpp
Line:  1364
Expression:  bSuccess
Message:

I already know, that in some xml-file a tag is missing. Is the file the one which is shown in the window "output" in VB at last the one with the missing tag? Is there a effective way for checking wich tag is missing at which point since some of the files are really big?

Thanks!
 
EDIT: This one I´ve fixed. I gave the Unit the default formation type.

Hi,

I think I´ve solved the one above. But when I start a new custom game, I´ve several new messages. Here is the first one:
Code:
modules\siedler\xml\units\siedler_civ4formationinfos.xml
Assert Failed

File:  CvInfos.cpp
Line:  5159
Expression:  false
Message:  [Jason] Unknown unit formation entry type.

I believe the problem is, that there are other things than UNIT, GENERAL and SIEGE in the UnitEntryTypes of the file Siedler_CIV4FormationInfos.
Code:
	<UnitFormation>
		<Name>Pioneer (6)</Name>
		<FormationType>FORMATION_TYPE_PIONEER</FormationType>
		<EventMaskList>
			<EventType>ENTITY_EVENT_IDLE</EventType>
			<EventType>ENTITY_EVENT_DIE</EventType>
			<EventType>ENTITY_EVENT_BEGIN_COMBAT</EventType>
			<EventType>ENTITY_EVENT_SURRENDER</EventType>
			<EventType>ENTITY_EVENT_CAPTURED</EventType>
			<EventType>ENTITY_EVENT_FOUND</EventType>
			<EventType>ENTITY_EVENT_SENTRY</EventType>
			<EventType>ENTITY_EVENT_SLEEP</EventType>
		</EventMaskList>
		<UnitEntry>
			<UnitEntryType>SETTLER_WAGON</UnitEntryType>
			<Position>
				<x>00.66</x>
				<y>-01.04</y>
			</Position>
			<PositionRadius>13.04</PositionRadius>
			<Direction>3.1416</Direction>
			<DirVariation>0.189</DirVariation>
		</UnitEntry>
		<UnitEntry>
			<UnitEntryType>DOG</UnitEntryType>
			<Position>
				<x>-00.94</x>
				<y>00.56</y>
			</Position>
			<PositionRadius>13.04</PositionRadius>
			<Direction>3.1416</Direction>
			<DirVariation>0.189</DirVariation>
		</UnitEntry>
		<UnitEntry>
			<UnitEntryType>SETTLER_MALE</UnitEntryType>
			<Position>
				<x>-00.14</x>
				<y>-01.18</y>
			</Position>
			<PositionRadius>13.04</PositionRadius>
			<Direction>3.1416</Direction>
			<DirVariation>0.189</DirVariation>
		</UnitEntry>
		<UnitEntry>
			<UnitEntryType>SETTLER_FEMALE</UnitEntryType>
			<Position>
				<x>-00.64</x>
				<y>-01.18</y>
			</Position>
			<PositionRadius>13.04</PositionRadius>
			<Direction>3.1416</Direction>
			<DirVariation>0.189</DirVariation>
		</UnitEntry>
		<UnitEntry>
			<UnitEntryType>SETTLER_CHILD</UnitEntryType>
			<Position>
				<x>-00.14</x>
				<y>00.71</y>
			</Position>
			<PositionRadius>13.04</PositionRadius>
			<Direction>3.1416</Direction>
			<DirVariation>0.189</DirVariation>
		</UnitEntry>
		<UnitEntry>
			<UnitEntryType>SETTLER_CHILD</UnitEntryType>
			<Position>
				<x>-00.29</x>
				<y>-00.04</y>
			</Position>
			<PositionRadius>13.04</PositionRadius>
			<Direction>3.1416</Direction>
			<DirVariation>0.189</DirVariation>
		</UnitEntry>
		<UnitEntry>
			<UnitEntryType>GENERAL</UnitEntryType>
			<Position>
				<x>-0.0805369127517</x>
				<y>0.835570469799</y>
			</Position>
			<PositionRadius>18.0</PositionRadius>
			<Direction>3.14159265359</Direction>
			<DirVariation>0.4472135955</DirVariation>
		</UnitEntry>
		<UnitEntry>
			<UnitEntryType>SIEGE</UnitEntryType>
			<Position>
				<x>-0.855704697987</x>
				<y>-0.634228187919</y>
			</Position>
			<PositionRadius>19.6468827044</PositionRadius>
			<Direction>2.38648825011</Direction>
			<DirVariation>0.722772439984</DirVariation>
		</UnitEntry>
	</UnitFormation>

In the game itself it seems to work. How can I say, that the new ones are allowed to?
 
Here is the second one:
Code:
Assert Failed

File:  CyGlobalContext.cpp
Line:  70
Expression:  idx>=0
Message:

It refers to this code and I´ve no idea what could be wrong. What is this code for?
Code:
CyPlayer* CyGlobalContext::getCyPlayer(int idx)
{
	static CyPlayer cyPlayers[MAX_PLAYERS];
	static bool bInit=false;

	if (!bInit)
	{
		int i;
		for(i=0;i<MAX_PLAYERS;i++)
			cyPlayers[i]=CyPlayer(&GET_PLAYER((PlayerTypes)i));
		bInit=true;
	}

	[COLOR="Red"]FAssert(idx>=0);[/COLOR]
	FAssert(idx<MAX_PLAYERS);

	return idx < MAX_PLAYERS && idx != NO_PLAYER ? &cyPlayers[idx] : NULL;
}
 
And now the third and last:
Code:
Assert Failed

File:  CvInitCore.cpp
Line:  1098
Expression:  eIndex < NUM_GAMEOPTION_TYPES
Message:  Index in CvInitCore::getOption expected to be < 24

Code:
bool CvInitCore::getOption(GameOptionTypes eIndex) const
{
	[COLOR="Red"]FASSERT_BOUNDS(0, NUM_GAMEOPTION_TYPES, eIndex, "CvInitCore::getOption");[/COLOR]
	if ( checkBounds(eIndex, 0, NUM_GAMEOPTION_TYPES) )
	{
		return m_abOptions[eIndex];
	}
	else
	{
		return false;
	}
}

I´m using smartmap which has many options to create a custom game. I believe this could cause the problem. Is there a place where I can change the number of expected gameoptions?
 
Here is the second one:
Code:
Assert Failed

File:  CyGlobalContext.cpp
Line:  70
Expression:  idx>=0
Message:

It refers to this code and I´ve no idea what could be wrong. What is this code for?
Code:
CyPlayer* CyGlobalContext::getCyPlayer(int idx)
{
	static CyPlayer cyPlayers[MAX_PLAYERS];
	static bool bInit=false;

	if (!bInit)
	{
		int i;
		for(i=0;i<MAX_PLAYERS;i++)
			cyPlayers[i]=CyPlayer(&GET_PLAYER((PlayerTypes)i));
		bInit=true;
	}

	[COLOR="Red"]FAssert(idx>=0);[/COLOR]
	FAssert(idx<MAX_PLAYERS);

	return idx < MAX_PLAYERS && idx != NO_PLAYER ? &cyPlayers[idx] : NULL;
}

Most likely:

Somewhere there is some Python that is trying to get a player object using a player index that is less than 0 (probably -1, as that is used for various "no such thing" values).

The actual Python would look something like "gc.getPlayer(iPlayer)" but iPlayer is not a valid value.
 
And now the third and last:
Code:
Assert Failed

File:  CvInitCore.cpp
Line:  1098
Expression:  eIndex < NUM_GAMEOPTION_TYPES
Message:  Index in CvInitCore::getOption expected to be < 24

Code:
bool CvInitCore::getOption(GameOptionTypes eIndex) const
{
	[COLOR="Red"]FASSERT_BOUNDS(0, NUM_GAMEOPTION_TYPES, eIndex, "CvInitCore::getOption");[/COLOR]
	if ( checkBounds(eIndex, 0, NUM_GAMEOPTION_TYPES) )
	{
		return m_abOptions[eIndex];
	}
	else
	{
		return false;
	}
}

I´m using smartmap which has many options to create a custom game. I believe this could cause the problem. Is there a place where I can change the number of expected gameoptions?

Map options and game options are two different things. Map options are controlled by the map script. Game options are defined in XML\GameInfo\CIV4GameOptionInfos.xml.

But game options are also defined in the DLL, in CvEnums.h. The options in the XML and in the DLL really must match to work correctly.
 
Hey God-Emperor!
Sry for highjacking the thread, but just noticed you here, and actually need some debugging dll help as well
Posted in this necro thread a couple minutes ago, not sure if you still following it: http://forums.civfanatics.com/showthread.php?t=336320
 
Most likely:

Somewhere there is some Python that is trying to get a player object using a player index that is less than 0 (probably -1, as that is used for various "no such thing" values).

The actual Python would look something like "gc.getPlayer(iPlayer)" but iPlayer is not a valid value.

In this case there will be I python error when Civ tries to run the code correct?

Is a code like this meant?
Code:
	def onChangeWar(self, argsList):
		'War Status Changes'
		bIsWar = argsList[0]
		iTeam = argsList[1]
		iRivalTeam = argsList[2]

		if bIsWar:
			pTeam = gc.getTeam(iTeam)
			pTeam2 = gc.getTeam(iRivalTeam)
			if pTeam2.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_ALHAMBRA")) == 1:
				for iPlayerX in xrange(gc.getMAX_CIV_PLAYERS()):
					pPlayerX = gc.getPlayer(iPlayerX)

There is no iPlayerX defined at the top and it´s used later.
 
In this case there will be I python error when Civ tries to run the code correct?

Not in this case, at least not directly from this. If the passed index is outside the range it returns NULL since the return statement checks for this. Depending on what the Python does with the returned value it might cause an error or it might not.

Is a code like this meant?
Code:
	def onChangeWar(self, argsList):
		'War Status Changes'
		bIsWar = argsList[0]
		iTeam = argsList[1]
		iRivalTeam = argsList[2]

		if bIsWar:
			pTeam = gc.getTeam(iTeam)
			pTeam2 = gc.getTeam(iRivalTeam)
			if pTeam2.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_ALHAMBRA")) == 1:
				for iPlayerX in xrange(gc.getMAX_CIV_PLAYERS()):
					pPlayerX = gc.getPlayer(iPlayerX)

There is no iPlayerX defined at the top and it´s used later.

Nothing wrong with that code in that respect. iPlayerX is defined by the "for" statement that assigns it a value. In Python you define a variable just by assigning it a value.
 
Ok. It´s a little bit hard for me to find the points where the index is less than 0.

I´ve many parts where gc.getPlayer(iPlayer) or something like that, just anything else in the brackets is used, but for my little knowledge alle seems to be defined.:confused:

Since I got the message about 140 times when I start a custom game, I´m a little bit afraid of this.

What do you mean with "probably -1, as that is used for various "no such thing" values". What are "no such thing" values? Do you have an example?

Btw. Thank you very much for your help so far. It´s good to have an expert explaining it, because it´s very confusing to me.
 
What do you mean with "probably -1, as that is used for various "no such thing" values". What are "no such thing" values? Do you have an example?

If you look at the return statement you can see where it says "idx != NO_PLAYER".
The NO_PLAYER value is -1. So are NO_UNIT, NO_PLOT, NO_BUILDING, NO_CIVILIZATION, etc.

If your Python uses something like
iThing = gc.getInfoTypeForString("THINGY_THING")
to try to get the value for THINGY_THING but it doesn't exist, then iThing will end up with the value -1. There is no such thing as THINGY_THING so it returned -1. This is one way you can end up using -1 for something where it really wants a valid value.
 
Ok. I think I got it.

The return statement is this:
Code:
return idx < MAX_PLAYERS &&[COLOR="Red"] idx != NO_PLAYER[/COLOR] ? &cyPlayers[idx] : NULL;

The red part is true, when gc.getPlayer(blablabla) is giving back a value of -1 because "blablabla" can´t be found because it´s not defined. In this cases the return statement will give back a NULL (the last part of the line)?

So the solution would be, that I´ve to check all my python files for gc.getPlayer and see where the thing in the brackets is not defined before using it. It can only be gc.getPlayer right?

Is there any tool which checks things like this and give you back the file and line of these errors or not defined parts?
 
Ok. I made some more tests and the failure seems only to occur when I take the smartmap-script. So the error seems to be in there but I only found one point with something like gc.getPlayer but it´s cgc.getPlayer (see red line below):

Code:
	for playerIndex in range(players):
		whichStartIndex = dice.get(len(finalPlots), "Python: SmartMap: Dice: Player Placement Plot Pick Place")
		#start player 0 (human in single player) near the middle IF wrapping
		if playerIndex == 0 and (wrapX or wrapY) and not centralPole and didWrap:
			nearestMidScore = 0
			nearestMidIndex = 0
			for startIndex in range(len(finalPlots)):
				plotScore = 0
				startPlotX,startPlotY = finalPlots[startIndex]
				if playerCoastalStart and not isCoastalPlot(startPlotX,startPlotY):
					continue
				if playerInlandStart and isCoastalPlot(startPlotX,startPlotY):
					continue
				if wrapX:
					distFromCenterFactor = (width*width) - (abs(startPlotX-int(width/2))*abs(startPlotX-int(width/2)))
					plotScore += distFromCenterFactor
				if wrapY:
					distFromCenterFactor = (height*height) - (abs(startPlotY-int(height/2))*abs(startPlotY-int(height/2)))
					plotScore += distFromCenterFactor
				if plotScore > nearestMidScore:
					nearestMidScore = plotScore
					nearestMidIndex = startIndex
			whichStartIndex = nearestMidIndex
			
			
		#pick one of the final placement plots at random
		startX,startY = finalPlots[whichStartIndex]
		del finalPlots[whichStartIndex]
		startPlot = cymap.plot(startX,startY)
		#assign the player to it
		startPlot.setStartingPlot(True) #I believe this helps the post-processor improve map fairness
		[COLOR="Red"]pPlayer = cgc.getPlayer(playerIndex)[/COLOR]
		pPlayer.setStartingPlot(startPlot,True)
		playerName = pPlayer.getName()
		print "player",playerName,"placed at",startX,startY,"coastal",isCoastalPlot(startX,startY)

There is another part defining the players:
players = cgc.getGame().countCivPlayersEverAlive()

But beside that I didn´t find anything where players are defined. Could one of these cause the errors? I´ve added the whole file for the case that someone would be so helpful to check it if the parts above are ok.:rolleyes:

Thank you!
 

Attachments

Ok. I´ve build successfully a debug-dll with all the addition I wanted to have in my mod. There is no error shown at the end. In the error list is just one warning:

warning C4101: 'iOverflow' : unreferenced local variable
D:\CIV SDK\Tools\cvgamecoredll_project\CvGameCoreDLL\CvCity.cpp 12815

When I click twice at the warning to show the code, it opens CvCity.cpp and suddenly 15 errors occur (see screenshot, sorry that it´s in german, but I didn´t find the place where I could change it in english :blush: ).

Could anyone explain me, why the errors are not shown before? Shouldn´t all errors be shown. I´m afraid if there are many more errors, which are not shown because I´ve not opened the files.

And the last thing. Since I´m not a programmer, how could I solve the message of the warning (iOverflow). It´s a part I haven´t change.

Thank you very much for your help.
 

Attachments

  • FehlerDebugging.JPG
    FehlerDebugging.JPG
    268.6 KB · Views: 91
And now a second, bigger problem. While playing the game, I got a crash to desktop, within the turn of the AI.

The last message before the crash is in the screenshot.

Any ideas?
 

Attachments

  • FehlerDebugging2.JPG
    FehlerDebugging2.JPG
    155.3 KB · Views: 64
Ok. I´ve build successfully a debug-dll with all the addition I wanted to have in my mod. There is no error shown at the end. In the error list is just one warning:



When I click twice at the warning to show the code, it opens CvCity.cpp and suddenly 15 errors occur (see screenshot, sorry that it´s in german, but I didn´t find the place where I could change it in english :blush: ).

Could anyone explain me, why the errors are not shown before? Shouldn´t all errors be shown. I´m afraid if there are many more errors, which are not shown because I´ve not opened the files.

And the last thing. Since I´m not a programmer, how could I solve the message of the warning (iOverflow). It´s a part I haven´t change.

Thank you very much for your help.
iOverflow is defined but not used which is harmless but the compiler warns you in case this was unintended.
The rest is just IntelliSense complaining about things which is no problem as it is independent of the compiler (it is just what provides you the autocomplete and similar stuff).

And now a second, bigger problem. While playing the game, I got a crash to desktop, within the turn of the AI.

The last message before the crash is in the screenshot.

Any ideas?
You are trying to dereference a NULL pointer. Press 'Unterbrechen' and check where the crash actually happens.
 
Thanks for the answer. When I tried the Unterbrechen-Button. It showed me line 5281 in CvTeam.cpp (in the background of the screenshot) and the message shows up again and again when I go on.

Before of this last message, there were four other one. Could they have something to do with that or are these problemsindependent from each other? If it would be useful, I can post the other messages too.
 
Thanks for the answer. When I tried the Unterbrechen-Button. It showed me line 5281 in CvTeam.cpp (in the background of the screenshot) and the message shows up again and again when I go on.

Before of this last message, there were four other one. Could they have something to do with that or are these problemsindependent from each other? If it would be useful, I can post the other messages too.
The first exception is likely the one closest to the issue.
In this case I'd say that likely eIndex was NO_TECH in that line.
 
Ok. I´ll write the messages that appear before the crash and the lines they refer to (in red).

1. Error
Spoiler :
Assert Failed

File: CvCity.cpp
Line: 1088
Expression: iCount == getBaseYieldRate((YieldTypes)iI)
Message:


CvCity.cpp, line 1088
Spoiler :
Code:
#ifdef _DEBUG
	{
		CvPlot* pPlot;
		int iCount;
		int iI, iJ;

		for (iI = 0; iI < NUM_YIELD_TYPES; iI++)
		{
			FAssert(getBaseYieldRate((YieldTypes)iI) >= 0);
			FAssert(getYieldRate((YieldTypes)iI) >= 0);

			iCount = 0;

			for (iJ = 0; iJ < NUM_CITY_PLOTS; iJ++)
			{
				if (isWorkingPlot(iJ))
				{
					pPlot = getCityIndexPlot(iJ);

					if (pPlot != NULL)
					{
						iCount += pPlot->getYield((YieldTypes)iI);
					}
				}
			}

			for (iJ = 0; iJ < GC.getNumSpecialistInfos(); iJ++)
			{
				iCount += (GET_PLAYER(getOwnerINLINE()).specialistYield(((SpecialistTypes)iJ), ((YieldTypes)iI)) * (getSpecialistCount((SpecialistTypes)iJ) + getFreeSpecialistCount((SpecialistTypes)iJ)));
			}

			for (iJ = 0; iJ < GC.getNumBuildingInfos(); iJ++)
			{
				iCount += getNumActiveBuilding((BuildingTypes)iJ) * (GC.getBuildingInfo((BuildingTypes) iJ).getYieldChange(iI) + getBuildingYieldChange((BuildingClassTypes)GC.getBuildingInfo((BuildingTypes) iJ).getBuildingClassType(), (YieldTypes)iI));
			}

			iCount += getTradeYield((YieldTypes)iI);
			iCount += getCorporationYield((YieldTypes)iI);

			[COLOR="Red"]FAssert(iCount == getBaseYieldRate((YieldTypes)iI));[/COLOR]
		}

		for (iI = 0; iI < NUM_COMMERCE_TYPES; iI++)
		{
			FAssert(getBuildingCommerce((CommerceTypes)iI) >= 0);
			FAssert(getSpecialistCommerce((CommerceTypes)iI) >= 0);
			FAssert(getReligionCommerce((CommerceTypes)iI) >= 0);
			FAssert(getCorporationCommerce((CommerceTypes)iI) >= 0);
			FAssert(GET_PLAYER(getOwnerINLINE()).getFreeCityCommerce((CommerceTypes)iI) >= 0);
		}

		for (iI = 0; iI < GC.getNumBonusInfos(); iI++)
		{
			FAssert(isNoBonus((BonusTypes)iI) || getNumBonuses((BonusTypes)iI) >= ((isConnectedToCapital()) ? (GET_PLAYER(getOwnerINLINE()).getBonusImport((BonusTypes)iI) - GET_PLAYER(getOwnerINLINE()).getBonusExport((BonusTypes)iI)) : 0));
		}
	}
#endif

2. Error (serveral times)
Spoiler :
Assert Failed

File: CvInfos.cpp
Line: 4086
Expression: iRouteType > -1
Message: Index out of bounds


CvInfos.cpp, line 4086
Spoiler :
Code:
// < JRouteNative Mod Start >
bool CvUnitInfo::getRouteNative(int iRouteType) const
{
	FAssertMsg(iRouteType < GC.getNumRouteInfos(), "Index out of bounds");
	FAssertMsg(iRouteType > -1, "Index out of bounds");
	return m_pbRouteNative ? m_pbRouteNative[iRouteType] : false;
}

bool CvUnitInfo::getRouteImpassable(int iRouteType) const
{
	FAssertMsg(iRouteType < GC.getNumRouteInfos(), "Index out of bounds");
	FAssertMsg(iRouteType > -1, "Index out of bounds");
	return m_pbRouteImpassable ? m_pbRouteImpassable[iRouteType] : false;
}

bool CvUnitInfo::getRouteIgnore(int iRouteType) const
{
	FAssertMsg(iRouteType < GC.getNumRouteInfos(), "Index out of bounds");
	[COLOR="Red"]FAssertMsg(iRouteType > -1, "Index out of bounds");[/COLOR]
	return m_pbRouteIgnore ? m_pbRouteIgnore[iRouteType] : false;
}

int CvUnitInfo::getRouteSubstitute(int iRouteType) const
{
	FAssertMsg(iRouteType < GC.getNumRouteInfos(), "Index out of bounds");
	FAssertMsg(iRouteType > -1, "Index out of bounds");
	return m_piRouteSubstitute ? m_piRouteSubstitute[iRouteType] : -1;
}
// < JRouteNative Mod End >


3. Error
Spoiler :
Assert Failed

File: CvCity.cpp
Line: 9769
Expression: m_aiCommerceRate[eIndex] >= 0
Message:


CvCity.cpp, line 9769
Spoiler :
Code:
void CvCity::updateCommerce(CommerceTypes eIndex)
{
	int iOldCommerce;
	int iNewCommerce;

	FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
	FAssertMsg(eIndex < NUM_COMMERCE_TYPES, "eIndex expected to be < NUM_COMMERCE_TYPES");

	iOldCommerce = m_aiCommerceRate[eIndex];

	if (isDisorder())
	{
		iNewCommerce = 0;
	}
	else
	{
		iNewCommerce = (getBaseCommerceRateTimes100(eIndex) * getTotalCommerceRateModifier(eIndex)) / 100;
		iNewCommerce += getYieldRate(YIELD_PRODUCTION) * getProductionToCommerceModifier(eIndex);
	}

	if (iOldCommerce != iNewCommerce)
	{
		m_aiCommerceRate[eIndex] = iNewCommerce;
		[COLOR="Red"]FAssert(m_aiCommerceRate[eIndex] >= 0);[/COLOR]

		GET_PLAYER(getOwnerINLINE()).invalidateCommerceRankCache(eIndex);

		GET_PLAYER(getOwnerINLINE()).changeCommerceRate(eIndex, (iNewCommerce - iOldCommerce));

		if (isCitySelected())
		{
			gDLL->getInterfaceIFace()->setDirty(InfoPane_DIRTY_BIT, true );
			gDLL->getInterfaceIFace()->setDirty(CityScreen_DIRTY_BIT, true);
		}
	}
}

4. Error
Spoiler :
Assert Failed

File: CvPlayer.cpp
Line: 12147
Expression: getCommerceRate(eIndex) >= 0
Message:


CvPlayer.cpp, line 12147
Spoiler :
Code:
void CvPlayer::changeCommerceRate(CommerceTypes eIndex, int iChange)
{
	FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
	FAssertMsg(eIndex < NUM_COMMERCE_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)");

	if (iChange != 0)
	{
		m_aiCommerceRate[eIndex] += iChange;
		[COLOR="Red"]FAssert(getCommerceRate(eIndex) >= 0);[/COLOR]

		if (getID() == GC.getGameINLINE().getActivePlayer())
		{
			gDLL->getInterfaceIFace()->setDirty(GameData_DIRTY_BIT, true);
		}
	}
}

After that nothing happens, but when I click somewhere, this error occurs:
Spoiler :
Unbehandelte Ausnahme bei 0x757ec41f in Civ4BeyondSword.exe: Microsoft C++-Ausnahme: std::bad_alloc an Speicherposition 0x0018e53c..


The debugging refers to the following line in CvTeam.cpp:
Spoiler :
Code:
void CvTeam::announceTechToPlayers(TechTypes eIndex, bool bPartial)
{
	bool bSound = ((GC.getGameINLINE().isNetworkMultiPlayer() || gDLL->getInterfaceIFace()->noTechSplash()) && !bPartial);

	for (int iI = 0; iI < MAX_PLAYERS; iI++)
	{
		if (GET_PLAYER((PlayerTypes)iI).isAlive())
		{
			if (GET_PLAYER((PlayerTypes)iI).getTeam() == getID())
			{
				[COLOR="Red"]CvWString szBuffer = gDLL->getText((bPartial ? "TXT_KEY_MISC_PROGRESS_TOWARDS_TECH" : "TXT_KEY_MISC_YOU_DISCOVERED_TECH"), GC.getTechInfo(eIndex).getTextKeyWide());[/COLOR]

				gDLL->getInterfaceIFace()->addMessage(((PlayerTypes)iI), false, (bSound ? GC.getEVENT_MESSAGE_TIME() : -1), szBuffer, (bSound ? GC.getTechInfo(eIndex).getSoundMP() : NULL), MESSAGE_TYPE_MAJOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_TECH_TEXT"));
			}
		}
	}
}

Finally it comes to this:
Spoiler :
Unbehandelte Ausnahme bei 0x00000000 in Civ4BeyondSword.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x00000000.


But it gives me no new line for that

Since, I´ve no knowledge about c++, I´ve almost no idea, what I should do to solve these problems.:(

Thank you very much for your help!
 
It seems to have run out of memory. That might be because you have some really large allocations going on somewhere or you have not enough memory for the size of maps you are running.

Some of the earlier asserts point at problems as well but that depends on where the functions are called from. Like one of the asserts happens because getRouteIgnore is called with a parameter of -1 (like the return of the loopup of a name that does not exist) or NO_ROUTE.
 
Back
Top Bottom