From b217768d0a241a57fda0b8ba565bbda06de30fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Tue, 30 Aug 2011 06:36:57 +0000 Subject: [PATCH] A patch from ori.bar fixing #37 and #64. http://forum.vcmi.eu/viewtopic.php?p=5993#5993 --- CCallback.h | 2 ++ README.linux | 2 +- client/CBattleInterface.cpp | 11 ++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CCallback.h b/CCallback.h index db60124b2..71e99c1cd 100644 --- a/CCallback.h +++ b/CCallback.h @@ -83,6 +83,8 @@ public: virtual void buildBoat(const IShipyard *obj) = 0; }; +struct CPack; + class CBattleCallback : public IBattleCallback, public CBattleInfoCallback { private: diff --git a/README.linux b/README.linux index d7452e22c..4b009536c 100644 --- a/README.linux +++ b/README.linux @@ -63,7 +63,7 @@ Install Heroes 3 and Wog. Then move all the installed files into Once both programs are installed, you can install VCMI. Download the windows VCMI release (at time of writing: -http://forum.vcmi.eu/dload.php?action=download&id=18) +http://forum.vcmi.eu/dload.php?action=download&id=21) and extract it in a private directory. Populate /YOUR_INSTALL_PATH/vcmi: mv sprites /YOUR_INSTALL_PATH/vcmi/Sprites diff --git a/client/CBattleInterface.cpp b/client/CBattleInterface.cpp index 78278cdc5..8f2700b75 100644 --- a/client/CBattleInterface.cpp +++ b/client/CBattleInterface.cpp @@ -1994,7 +1994,7 @@ void CBattleInterface::mouseMoved(const SDL_MouseMotionEvent &sEvent) } else { - if(std::find(occupyableHexes.begin(),occupyableHexes.end(),myNumber) == occupyableHexes.end()) + if(!vstd::contains(occupyableHexes, myNumber) || activeStack->coversPos(myNumber)) { const CStack *shere = curInt->cb->battleGetStackByPos(myNumber); const CStack *sactive = activeStack; @@ -3508,8 +3508,13 @@ void CBattleInterface::showAliveStack(const CStack *stack, SDL_Surface * to) && !stack->hasBonusOfType(Bonus::SIEGE_WEAPON) //and not a war machine... ) { - int xAdd = stack->attackerOwned ? 220 : 202; - + const THex nextPos = stack->position + (stack->attackerOwned ? 1 : -1); + const bool edge = stack->position % BFIELD_WIDTH == (stack->attackerOwned ? BFIELD_WIDTH - 2 : 1); + const bool moveInside = !edge && !vstd::contains(curInt->cb->battleGetAvailableHexes(stack, true), nextPos); + int xAdd = (stack->attackerOwned ? 220 : 202) + + (stack->doubleWide() ? 44 : 0) * (stack->attackerOwned ? +1 : -1) + + (moveInside ? amountNormal->w + 10 : 0) * (stack->attackerOwned ? -1 : +1); + //blitting amount background box SDL_Surface *amountBG = NULL; boost::shared_ptr spellEffects = stack->getSpellBonuses();