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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user