1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Fix assertion failure on teleport cast

This commit is contained in:
Ivan Savenko 2023-08-03 14:20:54 +03:00
parent 3f04db5163
commit 3213800097
2 changed files with 3 additions and 1 deletions

View File

@ -445,6 +445,8 @@ void BattleInterface::spellCast(const BattleSpellCast * sc)
stacksController->addNewAnim(new EffectAnimation(*this, side ? "SP07_B.DEF" : "SP07_A.DEF", rightHero)); stacksController->addNewAnim(new EffectAnimation(*this, side ? "SP07_B.DEF" : "SP07_A.DEF", rightHero));
}); });
} }
// animations will be executed by spell effects
} }
void BattleInterface::battleStacksEffectsSet(const SetStackEffect & sse) void BattleInterface::battleStacksEffectsSet(const SetStackEffect & sse)

View File

@ -499,7 +499,7 @@ void BattleStacksController::stacksAreAttacked(std::vector<StackAttackedInfo> at
void BattleStacksController::stackTeleported(const CStack *stack, std::vector<BattleHex> destHex, int distance) void BattleStacksController::stackTeleported(const CStack *stack, std::vector<BattleHex> destHex, int distance)
{ {
assert(destHex.size() > 0); assert(destHex.size() > 0);
owner.checkForAnimations(); //owner.checkForAnimations(); // NOTE: at this point spellcast animations were added, but not executed
owner.addToAnimationStage(EAnimationEvents::HIT, [=](){ owner.addToAnimationStage(EAnimationEvents::HIT, [=](){
addNewAnim( new ColorTransformAnimation(owner, stack, "teleportFadeOut", nullptr) ); addNewAnim( new ColorTransformAnimation(owner, stack, "teleportFadeOut", nullptr) );