fix: Added OnStopServer to NetworkMatchChecker

This commit is contained in:
MrGadget1024 2020-12-10 14:50:49 -05:00
parent 36814e6abb
commit 2f24d9aa2b

View File

@ -83,6 +83,14 @@ public override void OnStartServer()
// identity.RebuildObservers is called right after this from NetworkServer.SpawnObject // identity.RebuildObservers is called right after this from NetworkServer.SpawnObject
} }
public override void OnStopServer()
{
if (currentMatch == Guid.Empty) return;
if (matchPlayers.ContainsKey(currentMatch) && matchPlayers[currentMatch].Remove(netIdentity))
RebuildMatchObservers(currentMatch);
}
void RebuildMatchObservers(Guid specificMatch) void RebuildMatchObservers(Guid specificMatch)
{ {
foreach (NetworkIdentity networkIdentity in matchPlayers[specificMatch]) foreach (NetworkIdentity networkIdentity in matchPlayers[specificMatch])