Skip to content

Commit

Permalink
fix: also removing character when it is removed as owned
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Aug 2, 2023
1 parent 5124fec commit b96ed68
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Assets/Mirage/Runtime/NetworkPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ public void RemoveOwnedObject(NetworkIdentity identity)
if (logger.LogEnabled()) logger.Log($"Removing {identity} from Player[{Address}] OwnedObjects");

_ownedObjects.Remove(identity);

// if is main character, then also remove that
if (Identity == identity)
{
Identity = null;
}
}

/// <summary>
Expand Down

0 comments on commit b96ed68

Please sign in to comment.