Browse Source

Fix crash on starting battle in MP

Ivan Savenko 2 years ago
parent
commit
359af84d59
2 changed files with 4 additions and 1 deletions
  1. 3 0
      client/Client.cpp
  2. 1 1
      client/gui/CIntObject.h

+ 3 - 0
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)

+ 1 - 1
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
 {