- Fix a memory leak in AI "payTheManaCost"

- Minor fixes in AI code
- Attempt at preventing the AI from interrupting itself while it's selecting targets. I don't know why this happens, and my fix didn't work. I believe it shouldn't be possible to interrupt when there is an active targetChooser, please let me know if this is an incorrect assumption.
This commit is contained in:
wagic.the.homebrew
2011-09-21 03:54:47 +00:00
parent 206f3b4d3f
commit e9ce574bca
5 changed files with 748 additions and 113 deletions
+7
View File
@@ -586,6 +586,13 @@ int ActionStack::setIsInterrupting(Player * player)
return 0;
}
// Is it a valid interruption request, or is uninterruptible stuff going on in the game?
if (game->getCurrentTargetChooser())
{
DebugTrace("ActionStack: WARNING - We were asked to interrupt, but some un-interruptible action is already going on");
return 0;
}
int playerId = (player == game->players[1]) ? 1 : 0;
interruptDecision[playerId] = -1;
game->isInterrupting = player;