1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Don't give a turn to player who is about to lose (days without town).

This commit is contained in:
DjWarmonger
2015-10-24 16:21:30 +02:00
parent abe88ea890
commit 716c324695
3 changed files with 31 additions and 17 deletions

View File

@ -1623,18 +1623,8 @@ DLL_LINKAGE void YourTurn::applyGs( CGameState *gs )
{
gs->currentPlayer = player;
//count days without town
auto & playerState = gs->players[player];
if(playerState.towns.empty())
{
if(playerState.daysWithoutCastle)
++(*playerState.daysWithoutCastle);
else playerState.daysWithoutCastle = 0;
}
else
{
playerState.daysWithoutCastle = boost::none;
}
playerState.daysWithoutCastle = daysWithoutCastle;
}
DLL_LINKAGE Component::Component(const CStackBasicDescriptor &stack)