1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Not sure if I found a bug from CyInfoInterface2

Discussion in 'Civ4 - Unofficial Patches' started by NotSoGood, Jan 30, 2010.

  1. NotSoGood

    NotSoGood Chieftain

    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?
     
  2. phungus420

    phungus420 Chieftain

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    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.
     

Share This Page