Free Promotion Wonder

ripple01

Emperor
Joined
Mar 7, 2006
Messages
1,254
Location
New York City
Could anyone take a look at this Warlords 2.08 modcomp and update for BtS? I get a

||=== CvGameCoreDLL, Final Release Win32 ===|
CvPlayer.cpp|6984|error C2039: 'setFreePromotions' : is not a member of 'CvUnit'|
CvPlayer.cpp|6984|error C2039: 'getFreePromotions' : is not a member of 'CvUnit'|
||=== Build finished: 2 errors, 0 warnings ===|

error when I attempt to compile.

Any help would be greatly appreciated.

Cheers,
ripple01



// Start Addition FreePromotionWonder by Impaler[WrG]
if (GC.getBuildingInfo(eBuilding).getFreePromotions() > 0 && iChange > 0)
{
CvUnit* pLoopUnit;
int iLoop;

for (pLoopUnit = firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = nextUnit(&iLoop))
{
if (pLoopUnit->canFight() && pLoopUnit->canAcquirePromotionAny())
{
pLoopUnit->setFreePromotions(pLoopUnit->getFreePromotions() + GC.getBuildingInfo(eBuilding).getFreePromotions());
pLoopUnit->testPromotionReady();
}
}
}
// End Addition FreePromotionWonder by Impaler[WrG]
 
BTS did a lot of "cleanup" so to speak with their core coding. I've noticed this with a few other warlords mods I had to migrate for personal use, looking at the files it looks like they no longer distinguish between normal promotions and "free" promotions for a unit so you'll have to probably rewrite that function from scratch basically. It looks like Impaler used a custom function to return a list of free promotions, and I don't believe that there is any way to "mass award" promotions like that any more, so you'd have to go through the returned list one by one and activate each promotion for the unit.
 
Back
Top Bottom