Browse Source

* fixed crash with two-hex creatures

mateuszb 16 years ago
parent
commit
08723ecf84
1 changed files with 4 additions and 0 deletions
  1. 4 0
      client/CBattleInterface.cpp

+ 4 - 0
client/CBattleInterface.cpp

@@ -1578,6 +1578,10 @@ void CBattleInterface::newRound(int number)
 
 
 void CBattleInterface::giveCommand(ui8 action, ui16 tile, ui32 stack, si32 additional)
 void CBattleInterface::giveCommand(ui8 action, ui16 tile, ui32 stack, si32 additional)
 {
 {
+	if(!LOCPLINT->cb->battleGetStackByID(stack))
+	{
+		return;
+	}
 	BattleAction * ba = new BattleAction(); //is deleted in CPlayerInterface::activeStack()
 	BattleAction * ba = new BattleAction(); //is deleted in CPlayerInterface::activeStack()
 	ba->side = defendingHeroInstance ? (LOCPLINT->playerID == defendingHeroInstance->tempOwner) : false;
 	ba->side = defendingHeroInstance ? (LOCPLINT->playerID == defendingHeroInstance->tempOwner) : false;
 	ba->actionType = action;
 	ba->actionType = action;