From 2b9b21c99940a51f9b15082a30b1af0b3e9a4fdb Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Sat, 17 Dec 2022 17:34:53 +0100 Subject: [PATCH] fix a couple of incorrect assertions that lead to wrong refcounts --- src/network/netconnect.cpp | 2 -- src/unit/unit.cpp | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/netconnect.cpp b/src/network/netconnect.cpp index fe94a15de..2f1373427 100644 --- a/src/network/netconnect.cpp +++ b/src/network/netconnect.cpp @@ -1709,8 +1709,6 @@ void NetworkInitClientConnect() */ void NetworkServerStartGame() { - Assert(ServerSetupState.CompOpt[0] == SlotOption::Available); // the host should be slot 0 - // save it first.. LocalSetupState = ServerSetupState; diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 4fefcc0cf..d1fd0ca7c 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -1760,9 +1760,13 @@ void UnitCountSeen(CUnit &unit) break; } UnitGoesOutOfFog(unit, Players[p]); + unit.VisCount[p]++; } if (oldv[p] && !newv) { UnitGoesUnderFog(unit, Players[p]); + if (unit.VisCount[p]) { + unit.VisCount[p]--; + } } } }