1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Merge pull request #6243 from Laserlicht/battleonly

Battleonly mode
This commit is contained in:
Ivan Savenko
2025-11-06 14:33:44 +02:00
committed by GitHub
52 changed files with 1084 additions and 113 deletions

View File

@@ -3491,6 +3491,19 @@ void CGameHandler::checkVictoryLossConditionsForPlayer(PlayerColor player)
if(!p || p->status != EPlayerStatus::INGAME) return;
if(gameState().getMap().battleOnly)
{
for(const auto & playerIt : gameState().players)
{
PlayerEndsGame peg;
peg.player = playerIt.first;
peg.silentEnd = true;
sendAndApply(peg);
}
gameServer().setState(EServerState::SHUTDOWN);
return;
}
auto victoryLossCheckResult = gameState().checkForVictoryAndLoss(player);
if (victoryLossCheckResult.victory() || victoryLossCheckResult.loss())