How can iFlankingStrength = over 439826656 when it should be 100

Kailric

Jack of All Trades
Joined
Mar 25, 2008
Messages
3,100
Location
Marooned, Y'isrumgone
EDIT: FIPPING DUH.. I simply had a parenthesis in the wrong place in my log code!!!


I am having trouble figuring out what is going on here. I print to a log file the iFlankingStrength variable at different points in the code. Below in italic bold I note what the log says... can someone explain how iFlankingStrength can equal over 439826656 at the start.. then go to 100 a few lines later when there is no noted change?

CvUnit.cpp

Code:
int iFlankingStrength = [I][B](here the variable = 439826656 or so)[/B][/I]m_pUnitInfo->getFlankingStrikeUnitClass(pLoopUnit->getUnitClassType());

	if (iFlankingStrength > 0)
	{
		int iDefenderStrength;
		int iDefenderOdds;
		int iAttackerDamage;
		int iDefenderDamage;
getDefenderCombatValues(*pLoopUnit, pPlot, iAttackerStrength, iAttackerFirepower, iDefenderOdds, iDefenderStrength, iAttackerDamage, iDefenderDamage);
if(GC.getGameINLINE().getSorenRandNum(GC.getDefineINT("COMBAT_DIE_SIDES"), "Combat") >= iDefenderOdds)
{pLoopUnit->changeDamage((iFlankingStrength [I][B](here the log shows it equals 100) [/B][/I]* iDefenderDamage) / 100, getOwnerINLINE());


This is the code that gets the value of iFlankingStrength in the CvInfos file.

Code:
int CvUnitInfo::getFlankingStrikeUnitClass(int i) const
{
	FAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds");
	FAssertMsg(i > -1, "Index out of bounds");
	return m_piFlankingStrikeUnitClass ? m_piFlankingStrikeUnitClass[i] : -1;
}
 
Back
Top Bottom