From 359af84d5900736ddea888ee51e0f66d9add0fc2 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 9 Nov 2023 00:33:34 +0200 Subject: [PATCH] Fix crash on starting battle in MP --- client/Client.cpp | 3 +++ client/gui/CIntObject.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/Client.cpp b/client/Client.cpp index c6e99d405..6bf4de6cd 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -641,6 +641,9 @@ void CClient::battleFinished(const BattleID & battleID) void CClient::startPlayerBattleAction(const BattleID & battleID, PlayerColor color) { + if (battleints.count(color) == 0) + return; // not our combat in MP + auto battleint = battleints.at(color); if (!battleint->human) diff --git a/client/gui/CIntObject.h b/client/gui/CIntObject.h index 723cfcc4e..7909e72e7 100644 --- a/client/gui/CIntObject.h +++ b/client/gui/CIntObject.h @@ -21,7 +21,7 @@ class Canvas; VCMI_LIB_NAMESPACE_BEGIN class CArmedInstance; -VCMI_LIB_NAMESPACE_BEGIN +VCMI_LIB_NAMESPACE_END class IUpdateable {