1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Various player/AI interface related fixes and improvements.

This commit is contained in:
Michał W. Urbańczyk
2011-07-17 18:49:05 +00:00
parent ef954b8a4f
commit 79f5b29196
10 changed files with 48 additions and 34 deletions

View File

@@ -65,7 +65,11 @@ bool CloseServer::applyGh( CGameHandler *gh )
bool EndTurn::applyGh( CGameHandler *gh )
{
ERROR_IF_NOT(GS(gh)->currentPlayer);
int player = GS(gh)->currentPlayer;
ERROR_IF_NOT(player);
if(gh->states.checkFlag(player, &PlayerStatus::engagedIntoBattle))
COMPLAIN_AND_RETURN("Cannot end turn when in battle!");
gh->states.setFlag(GS(gh)->currentPlayer,&PlayerStatus::makingTurn,false);
return true;
}