mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Merge pull request #198 from vcmi/SpellsRefactoring8
No reason to not merge this now.
This commit is contained in:
@@ -1227,6 +1227,15 @@ DLL_LINKAGE void BattleNextRound::applyGs( CGameState *gs )
|
||||
s->counterAttacksTotalCache = 0;
|
||||
// new turn effects
|
||||
s->battleTurnPassed();
|
||||
|
||||
if(s->alive() && vstd::contains(s->state, EBattleStackState::CLONED))
|
||||
{
|
||||
//cloned stack has special lifetime marker
|
||||
//check it after bonuses updated in battleTurnPassed()
|
||||
|
||||
if(!s->hasBonus(Selector::type(Bonus::NONE).And(Selector::source(Bonus::SPELL_EFFECT, SpellID::CLONE))))
|
||||
s->makeGhost();
|
||||
}
|
||||
}
|
||||
|
||||
for(auto &obst : gs->curB->obstacles)
|
||||
@@ -1712,6 +1721,13 @@ DLL_LINKAGE void BattleStacksRemoved::applyGs( CGameState *gs )
|
||||
toRemove->cloneID = -1;
|
||||
}
|
||||
|
||||
//cleanup remaining clone links if any
|
||||
for(CStack * s : gs->curB->stacks)
|
||||
{
|
||||
if(s->cloneID == toRemove->ID)
|
||||
s->cloneID = -1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user