Browse Source

A patch from ori.bar fixing #37 and #64.
http://forum.vcmi.eu/viewtopic.php?p=5993#5993

Michał W. Urbańczyk 14 years ago
parent
commit
b217768d0a
3 changed files with 11 additions and 4 deletions
  1. 2 0
      CCallback.h
  2. 1 1
      README.linux
  3. 8 3
      client/CBattleInterface.cpp

+ 2 - 0
CCallback.h

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

+ 1 - 1
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

+ 8 - 3
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<BonusList> spellEffects = stack->getSpellBonuses();