mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: MatchInterestManagement - use TryGetValue in OnDestroyed
This commit is contained in:
parent
186702f810
commit
f67aa64d59
@ -43,10 +43,12 @@ public override void OnSpawned(NetworkIdentity identity)
|
||||
|
||||
public override void OnDestroyed(NetworkIdentity identity)
|
||||
{
|
||||
lastObjectMatch.TryGetValue(identity, out Guid currentMatch);
|
||||
lastObjectMatch.Remove(identity);
|
||||
if (currentMatch != Guid.Empty && matchObjects.TryGetValue(currentMatch, out HashSet<NetworkIdentity> objects) && objects.Remove(identity))
|
||||
RebuildMatchObservers(currentMatch);
|
||||
if (lastObjectMatch.TryGetValue(identity, out Guid currentMatch))
|
||||
{
|
||||
lastObjectMatch.Remove(identity);
|
||||
if (currentMatch != Guid.Empty && matchObjects.TryGetValue(currentMatch, out HashSet<NetworkIdentity> objects) && objects.Remove(identity))
|
||||
RebuildMatchObservers(currentMatch);
|
||||
}
|
||||
}
|
||||
|
||||
// internal so we can update from tests
|
||||
|
Loading…
Reference in New Issue
Block a user