1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Big change: Introduced new mechanism to handle queries. It should not cause any visible changes ATM apart from fixing several long-standing bugs realted to handling post-visit/battle/levelup callback, including infamous creature bank issues: #955, #1053, #1063, #1191. Needs testing.

Minor changes:
* default log level set to trace
* LOG_TRACE raii guardian lifetime will last till the end of block
* compile fixes
* minor refactorings
This commit is contained in:
Michał W. Urbańczyk
2013-04-20 11:34:01 +00:00
parent 1fca335a2c
commit e8354908c3
30 changed files with 1481 additions and 875 deletions

View File

@@ -69,8 +69,8 @@ bool EndTurn::applyGh( CGameHandler *gh )
{
PlayerColor player = GS(gh)->currentPlayer;
ERROR_IF_NOT(player);
if(gh->states.checkFlag(player, &PlayerStatus::engagedIntoBattle))
COMPLAIN_AND_RETURN("Cannot end turn when in battle!");
if(gh->queries.topQuery(player))
COMPLAIN_AND_RETURN("Cannot end turn before resolving queries!");
gh->states.setFlag(GS(gh)->currentPlayer,&PlayerStatus::makingTurn,false);
return true;