Trouble Merging FirstStrike

Kailric

Jack of All Trades
Joined
Mar 25, 2008
Messages
3,100
Location
Marooned, Y'isrumgone
I am trying to merge the FirstStrike ability to Colonization. I have done mergeing of this kind before as I have merged the CvPlotGroups so I have a little experence at this but I am completly stumped on this one.

I narrowed down the problem, when I add in the "int m_aFirstStrikes" to the CvStructs.h it causes a crash. I can have only that change and it still causes a crash.

Code:
int m_aDamage[BATTLE_UNIT_COUNT][BATTLE_TIME_COUNT];
//TK FS
int m_aFirstStrikes[BATTLE_UNIT_COUNT];
int m_iNumRangedRounds;
int m_iNumMeleeRounds;

Using Debug mode I found exactly where the crash happens. When the CvUnit.cpp code trys to Add the Mission:

Code:
if (pPlot->isActiveVisible(false))
{
	ExecuteMove(0.5f, true);
	gDLL->getEntityIFace()->AddMission(&kBattle);
}

I get a Failed Assert in CvStructs at:

Code:
void CvBattleDefinition::checkBattleRound(int index) const
{
	FAssertMsg((index >= 0) && (index < (int)m_aBattleRounds.size()), "[Jason] Invalid battle round index.");
}

And then soon after the game crashes. If I comment out the "gDLL->getEntityIFace()->AddMission(&kBattle);" the battle takes place with no crashes but no animations play. I have searched up and down the SDK and in python for any references to "FirstStrike" that could be causing this but can find nothing.

If I set the game to "Quick Combat" everthing works fine.

Anyone have any idea what is happening here?
 
Back
Top Bottom