From cf08b8bf50ac8337fb4f3711313d2f6103ba60f6 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 10 Dec 2024 11:15:58 +0000 Subject: [PATCH] Fix game not ending on victory of allied human players in hotseat --- client/NetPacksClient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index 1c94e0d7d..cf1c896a1 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -430,9 +430,10 @@ void ApplyClientNetPackVisitor::visitPlayerEndsGame(PlayerEndsGame & pack) { callAllInterfaces(cl, &IGameEventsReceiver::gameOver, pack.player, pack.victoryLossCheckResult); + bool localHumanWinsGame = vstd::contains(cl.playerint, pack.player) && cl.getPlayerState(pack.player)->human && pack.victoryLossCheckResult.victory(); bool lastHumanEndsGame = CSH->howManyPlayerInterfaces() == 1 && vstd::contains(cl.playerint, pack.player) && cl.getPlayerState(pack.player)->human && !settings["session"]["spectate"].Bool(); - if(lastHumanEndsGame) + if(lastHumanEndsGame || localHumanWinsGame) { assert(adventureInt); if(adventureInt)