Forráskód Böngészése

Ouch. #37 is not so easy. :>

Michał W. Urbańczyk 14 éve
szülő
commit
1bd543ad0c
2 módosított fájl, 9 hozzáadás és 1 törlés
  1. 8 1
      client/CBattleInterface.cpp
  2. 1 0
      client/CBattleInterface.h

+ 8 - 1
client/CBattleInterface.cpp

@@ -3510,7 +3510,7 @@ void CBattleInterface::showAliveStack(const CStack *stack, SDL_Surface * to)
 	{
         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);
+        const bool moveInside = !edge && !isHexAccessible(nextPos);
 		int xAdd = (stack->attackerOwned ? 220 : 202) +
                    (stack->doubleWide() ? 44 : 0) * (stack->attackerOwned ? +1 : -1) +
                    (moveInside ? amountNormal->w + 10 : 0) * (stack->attackerOwned ? -1 : +1);
@@ -3959,6 +3959,13 @@ void CBattleInterface::bTacticNextStack()
 		stackActivated(stacksOfMine.front());
 }
 
+bool CBattleInterface::isHexAccessible(THex nextPos)
+{
+	//!vstd::contains(curInt->cb->battleGetAvailableHexes(stack, true), nextPos)
+	//TODO has to be fast
+	return true;
+}
+
 void CBattleHero::show(SDL_Surface *to)
 {
 	//animation of flag

+ 1 - 0
client/CBattleInterface.h

@@ -460,6 +460,7 @@ private:
 	void giveCommand(ui8 action, THex tile, ui32 stack, si32 additional=-1);
 	bool isTileAttackable(const THex & number) const; //returns true if tile 'number' is neighboring any tile from active stack's range or is one of these tiles
 	bool blockedByObstacle(THex hex) const;
+	bool isHexAccessible(THex nextPos);
 	bool isCatapultAttackable(THex hex) const; //returns true if given tile can be attacked by catapult
 
 	std::list<SBattleEffect> battleEffects; //different animations to display on the screen like spell effects