diff --git a/client/battle/BattleStacksController.cpp b/client/battle/BattleStacksController.cpp index 00c42155c..3bbbba7dd 100644 --- a/client/battle/BattleStacksController.cpp +++ b/client/battle/BattleStacksController.cpp @@ -348,7 +348,11 @@ void BattleStacksController::update() void BattleStacksController::updateBattleAnimations() { - for (auto & elem : currentAnimations) + // operate on copy - to prevent potential iterator invalidation due to push_back's + // FIXME? : remove remaining calls to addNewAnim from BattleAnimation::nextFrame (only Catapult explosion at the time of writing) + auto copiedVector = currentAnimations; + + for (auto & elem : copiedVector) { if (!elem) continue;