Selaa lähdekoodia

BattleAction: handle obstacle for standing units

Konstantin 2 vuotta sitten
vanhempi
sitoutus
f6b03201db
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      server/battles/BattleActionProcessor.cpp

+ 2 - 0
server/battles/BattleActionProcessor.cpp

@@ -852,6 +852,8 @@ int BattleActionProcessor::moveStack(const CBattleInfoCallback & battle, int sta
 			|| start == battle::Unit::occupiedHex(dest, curStack->doubleWide(), curStack->unitSide()))
 			|| start == battle::Unit::occupiedHex(dest, curStack->doubleWide(), curStack->unitSide()))
 			passed.clear(); //Just empty passed, obstacles will handled automatically
 			passed.clear(); //Just empty passed, obstacles will handled automatically
 	}
 	}
+	if(dest == start) 	//If dest is equal to start, then we should handle obstacles for it anyway
+		passed.clear();	//Just empty passed, obstacles will handled automatically
 	//handling obstacle on the final field (separate, because it affects both flying and walking stacks)
 	//handling obstacle on the final field (separate, because it affects both flying and walking stacks)
 	battle.handleObstacleTriggersForUnit(*gameHandler->spellEnv, *curStack, passed);
 	battle.handleObstacleTriggersForUnit(*gameHandler->spellEnv, *curStack, passed);