Not sure if I found a bug from CyInfoInterface2

NotSoGood

Emperor
Joined
Jan 25, 2009
Messages
1,077
Location
Finland
While editing my mod's dll, I stumbled into this when adding a iHealth tag for improvements
Code:
...
	python::class_<CvImprovementInfo, python::bases<CvInfoBase> >("CvImprovementInfo")

		.def("getTilesPerGoody", &CvImprovementInfo::getTilesPerGoody, "int ()")
		.def("getGoodyUniqueRange", &CvImprovementInfo::getGoodyUniqueRange, "int ()")
		.def("getFeatureGrowthProbability", &CvImprovementInfo::getFeatureGrowthProbability, "int ()")
		.def("getUpgradeTime", &CvImprovementInfo::getUpgradeTime, "int ()")
		.def("getAirBombDefense", &CvImprovementInfo::getAirBombDefense, "int ()")
		.def("getDefenseModifier", &CvImprovementInfo::getDefenseModifier, "int ()")
		[COLOR="Red"].def("getHappiness", &CvImprovementInfo::[COLOR="Blue"]getDefenseModifier[/COLOR], "int ()")[/COLOR]
		.def("getPillageGold", &CvImprovementInfo::getPillageGold, "int ()")
		.def("getImprovementPillage", &CvImprovementInfo::getImprovementPillage, "int ()")
		.def("getImprovementUpgrade", &CvImprovementInfo::getImprovementUpgrade, "int ()")
...
I was just wondering, because every else has like "getHealth" and &CvImprovementInfo::getHealth, but somehow "getHappiness" has getDefenseModifier. I'm not even sure what these things do. This was from UP 1.4, so I'm sure it isn't fixed yet. Can anyone confirm if this is a bug or not?
 
That would definatly be a bug, yep. A typical cut and paste error, easy to do. The effect of which would be that when someone does a python call to see the Happiness from an improvement, the call will return the value of the defense modifier stored in the XML, instead of happiness.
 
Top Bottom