fix a couple of incorrect assertions that lead to wrong refcounts

This commit is contained in:
Tim Felgentreff 2022-12-17 17:34:53 +01:00
parent 51dae7271d
commit 2b9b21c999
2 changed files with 4 additions and 2 deletions

View file

@ -1709,8 +1709,6 @@ void NetworkInitClientConnect()
*/ */
void NetworkServerStartGame() void NetworkServerStartGame()
{ {
Assert(ServerSetupState.CompOpt[0] == SlotOption::Available); // the host should be slot 0
// save it first.. // save it first..
LocalSetupState = ServerSetupState; LocalSetupState = ServerSetupState;

View file

@ -1760,9 +1760,13 @@ void UnitCountSeen(CUnit &unit)
break; break;
} }
UnitGoesOutOfFog(unit, Players[p]); UnitGoesOutOfFog(unit, Players[p]);
unit.VisCount[p]++;
} }
if (oldv[p] && !newv) { if (oldv[p] && !newv) {
UnitGoesUnderFog(unit, Players[p]); UnitGoesUnderFog(unit, Players[p]);
if (unit.VisCount[p]) {
unit.VisCount[p]--;
}
} }
} }
} }