Jeckel
Great Reverend
Only those of us that traveled through the wormhole remember what happen in the alternate timeline. 


TheLopez said:Kael, did I miss something?
![]()

void CvPlayer::addTrait(TraitTypes eTrait)
{
CvTraitInfo objTraitInfo;
int iJ;
FAssertMsg((eTrait >= 0), "eTrait is less than zero");
if(m_pbTraits[(int)eTrait])
{
return;
}
m_pbTraits[(int)eTrait] = true;
changeExtraHealth(GC.getTraitInfo(eTrait).getHealth());
changeUpkeepModifier(GC.getTraitInfo(eTrait).getUpkeepModifier());
changeGreatPeopleRateModifier(GC.getTraitInfo(eTrait).getGreatPeopleRateModifier());
changeMaxGlobalBuildingProductionModifier(GC.getTraitInfo(eTrait).getMaxGlobalBuildingProductionModifier());
changeMaxTeamBuildingProductionModifier(GC.getTraitInfo(eTrait).getMaxTeamBuildingProductionModifier());
changeMaxPlayerBuildingProductionModifier(GC.getTraitInfo(eTrait).getMaxPlayerBuildingProductionModifier());
for (iJ = 0; iJ < NUM_YIELD_TYPES; iJ++)
{
changeTradeYieldModifier(((YieldTypes)iJ), GC.getTraitInfo(eTrait).getTradeYieldModifier(iJ));
}
for (iJ = 0; iJ < NUM_COMMERCE_TYPES; iJ++)
{
changeFreeCityCommerce(((CommerceTypes)iJ), GC.getTraitInfo(eTrait).getCommerceChange(iJ));
changeCommerceRateModifier(((CommerceTypes)iJ), GC.getTraitInfo(eTrait).getCommerceModifier(iJ));
}
for (iJ = 0; iJ < GC.getNumCivicOptionInfos(); iJ++)
{
if (GC.getCivicOptionInfo((CivicOptionTypes) iJ).getTraitNoUpkeep((int)eTrait))
{
setNoCivicUpkeepCount(((CivicOptionTypes)iJ), 1);
}
}
[b] for (iJ = 0; iJ < NUM_YIELD_TYPES; iJ++)
{
updateExtraYieldThreshold((YieldTypes)iJ);
}[/b]
updateMaxAnarchyTurns();
}
void CvPlayer::removeTrait(TraitTypes eTrait)
{
CvTraitInfo objTraitInfo;
int iJ;
FAssertMsg((eTrait >= 0), "eTrait is less than zero");
if(!m_pbTraits[(int)eTrait])
{
return;
}
m_pbTraits[(int)eTrait] = false;
changeExtraHealth(-GC.getTraitInfo(eTrait).getHealth());
changeUpkeepModifier(-GC.getTraitInfo(eTrait).getUpkeepModifier());
changeGreatPeopleRateModifier(-GC.getTraitInfo(eTrait).getGreatPeopleRateModifier());
changeMaxGlobalBuildingProductionModifier(-GC.getTraitInfo(eTrait).getMaxGlobalBuildingProductionModifier());
changeMaxTeamBuildingProductionModifier(-GC.getTraitInfo(eTrait).getMaxTeamBuildingProductionModifier());
changeMaxPlayerBuildingProductionModifier(-GC.getTraitInfo(eTrait).getMaxPlayerBuildingProductionModifier());
for (iJ = 0; iJ < NUM_YIELD_TYPES; iJ++)
{
changeTradeYieldModifier(((YieldTypes)iJ), -GC.getTraitInfo(eTrait).getTradeYieldModifier(iJ));
}
for (iJ = 0; iJ < NUM_COMMERCE_TYPES; iJ++)
{
changeFreeCityCommerce(((CommerceTypes)iJ), -GC.getTraitInfo(eTrait).getCommerceChange(iJ));
changeCommerceRateModifier(((CommerceTypes)iJ), -GC.getTraitInfo(eTrait).getCommerceModifier(iJ));
}
for (iJ = 0; iJ < GC.getNumCivicOptionInfos(); iJ++)
{
if (GC.getCivicOptionInfo((CivicOptionTypes) iJ).getTraitNoUpkeep((int)eTrait))
{
setNoCivicUpkeepCount(((CivicOptionTypes)iJ), 0);
}
}
[b] for (iJ = 0; iJ < NUM_YIELD_TYPES; iJ++)
{
updateExtraYieldThreshold((YieldTypes)iJ);
}[/b]
updateMaxAnarchyTurns();
}
void CvPlayer::setNoCivicUpkeepCount(CivicOptionTypes eIndex, int iNewValue)
{
FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
FAssertMsg(eIndex < GC.getNumCivicOptionInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");
// if (iNewValue != 0)
// {
m_paiNoCivicUpkeepCount[eIndex] = iNewValue;
FAssert(getNoCivicUpkeepCount(eIndex) >= 0);
if (getID() == GC.getGameINLINE().getActivePlayer())
{
gDLL->getInterfaceIFace()->setDirty(GameData_DIRTY_BIT, true);
}
// }
}
TheLopez said:Kael, is this fix for the Warlords version or Vanilla?
Impaler[WrG] said:Yes I'm going to put my new Trait tags in their as well and any tags I add in the future as well.
I simplified the code still further, now the Player Initialization is routed to ProcessTrait so ALL trait code can be in one place, also I was able to drop the setNoCivicUpkeep function and use the original changeNoCivicUpkeep function that Firaxis was using. This code could now form the core of a Leader changing function, I belive jdog5000 has made such a function, I'll be looking to merge these together now.
reviving this thread -- I am starting to get into modding myself a little, and am wondering if this is compatible with BtS without too much of a headache?