mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fixes issue of bonuses not correctly removed
This commit is contained in:
@@ -414,8 +414,20 @@ void CBonusSystemNode::unpropagateBonus(const std::shared_ptr<Bonus> & b)
|
||||
{
|
||||
if(b->propagator->shouldBeAttached(this))
|
||||
{
|
||||
bonuses -= b;
|
||||
logBonus->trace("#$# %s #is no longer propagated to# %s", b->Description(), nodeName());
|
||||
if (bonuses -= b)
|
||||
logBonus->trace("#$# %s #is no longer propagated to# %s", b->Description(), nodeName());
|
||||
else
|
||||
logBonus->error("Error on unpropagateBonus. #$# %s is not propagated to %s", b->Description(), nodeName());
|
||||
|
||||
bonuses.remove_if([this, b](const auto & bonus)
|
||||
{
|
||||
if (bonus->propagationUpdater && bonus->propagationUpdater == b->propagationUpdater)
|
||||
{
|
||||
treeHasChanged();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
TNodes lchildren;
|
||||
|
||||
Reference in New Issue
Block a user