1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00

A patch from ori.bar fixing #37 and #64.

http://forum.vcmi.eu/viewtopic.php?p=5993#5993
This commit is contained in:
Michał W. Urbańczyk 2011-08-30 06:36:57 +00:00
parent 835bd1fbeb
commit b217768d0a
3 changed files with 11 additions and 4 deletions

View File

@ -83,6 +83,8 @@ public:
virtual void buildBoat(const IShipyard *obj) = 0; virtual void buildBoat(const IShipyard *obj) = 0;
}; };
struct CPack;
class CBattleCallback : public IBattleCallback, public CBattleInfoCallback class CBattleCallback : public IBattleCallback, public CBattleInfoCallback
{ {
private: private:

View File

@ -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. Once both programs are installed, you can install VCMI.
Download the windows VCMI release (at time of writing: 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: and extract it in a private directory. Populate /YOUR_INSTALL_PATH/vcmi:
mv sprites /YOUR_INSTALL_PATH/vcmi/Sprites mv sprites /YOUR_INSTALL_PATH/vcmi/Sprites

View File

@ -1994,7 +1994,7 @@ void CBattleInterface::mouseMoved(const SDL_MouseMotionEvent &sEvent)
} }
else 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 *shere = curInt->cb->battleGetStackByPos(myNumber);
const CStack *sactive = activeStack; 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... && !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 //blitting amount background box
SDL_Surface *amountBG = NULL; SDL_Surface *amountBG = NULL;
boost::shared_ptr<BonusList> spellEffects = stack->getSpellBonuses(); boost::shared_ptr<BonusList> spellEffects = stack->getSpellBonuses();