mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Bonus system: add treeHasChanged call where bonus objects changed
This commit is contained in:
parent
1730a31471
commit
59199ccdbd
@ -694,6 +694,7 @@ void CArtHandler::afterLoadFinalization()
|
||||
bonus->sid = art->id;
|
||||
}
|
||||
}
|
||||
CBonusSystemNode::treeHasChanged();
|
||||
|
||||
for (CArtifact * art : artifacts)
|
||||
{
|
||||
|
@ -140,6 +140,7 @@ void CCreature::setId(CreatureID ID)
|
||||
if(bonus->source == Bonus::CREATURE_ABILITY)
|
||||
bonus->sid = ID;
|
||||
}
|
||||
CBonusSystemNode::treeHasChanged();
|
||||
}
|
||||
|
||||
static void AddAbility(CCreature *cre, const JsonVector &ability_vec)
|
||||
|
@ -96,6 +96,7 @@ void CArmedInstance::updateMoraleBonusFromArmy()
|
||||
b->description = b->description.substr(0, b->description.size()-2);//trim value
|
||||
}
|
||||
boost::algorithm::trim(b->description);
|
||||
CBonusSystemNode::treeHasChanged();
|
||||
|
||||
//-1 modifier for any Undead unit in army
|
||||
const ui8 UNDEAD_MODIFIER_ID = -2;
|
||||
|
@ -831,6 +831,7 @@ void CGHeroInstance::updateSkill(SecondarySkill which, int val)
|
||||
addNewBonus(bonus);
|
||||
}
|
||||
|
||||
CBonusSystemNode::treeHasChanged();
|
||||
}
|
||||
void CGHeroInstance::setPropertyDer( ui8 what, ui32 val )
|
||||
{
|
||||
@ -1365,6 +1366,7 @@ void CGHeroInstance::setPrimarySkill(PrimarySkill::PrimarySkill primarySkill, si
|
||||
{
|
||||
skill->val += value;
|
||||
}
|
||||
CBonusSystemNode::treeHasChanged();
|
||||
}
|
||||
else if(primarySkill == PrimarySkill::EXPERIENCE)
|
||||
{
|
||||
|
@ -864,7 +864,10 @@ void CGTownInstance::updateMoraleBonusFromArmy()
|
||||
}
|
||||
|
||||
if (garrisonHero)
|
||||
{
|
||||
b->val = 0;
|
||||
CBonusSystemNode::treeHasChanged();
|
||||
}
|
||||
else
|
||||
CArmedInstance::updateMoraleBonusFromArmy();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user