From 57580b87e15cf537310f2231bea22680009f8a58 Mon Sep 17 00:00:00 2001 From: mateuszb Date: Fri, 14 Jan 2011 18:08:01 +0000 Subject: [PATCH] * minor fix for battle interface --- client/CBattleInterface.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/client/CBattleInterface.cpp b/client/CBattleInterface.cpp index b9d2ed0fc..d1bc58337 100644 --- a/client/CBattleInterface.cpp +++ b/client/CBattleInterface.cpp @@ -1589,15 +1589,6 @@ void CBattleInterface::show(SDL_Surface * to) if(!active) activate(); - //restoring good directions of stacks - BOOST_FOREACH(const CStack *s, stacks) - { - if(creDir[s->ID] != bool(s->attackerOwned) && s->alive()) - { - addNewAnim(new CReverseAnim(this, s, s->position, false)); - } - } - //activation of next stack if(pendingAnims.size() == 0 && stackToActivate != NULL) { @@ -3233,6 +3224,20 @@ void CBattleInterface::endAction(const BattleAction* action) if(action->actionType == BattleAction::CATAPULT) //catapult { } + + //check if we should reverse stacks + std::vector stacks; + stacks.push_back(LOCPLINT->cb->battleGetStackByID(action->stackNumber)); + stacks.push_back(LOCPLINT->cb->battleGetStackByPos(action->destinationTile)); + + BOOST_FOREACH(const CStack *s, stacks) + { + if(s && creDir[s->ID] != bool(s->attackerOwned) && s->alive()) + { + addNewAnim(new CReverseAnim(this, s, s->position, false)); + } + } + queue->update(); }