Skip to content

Commit

Permalink
fix: unspawning all server object on server stop
Browse files Browse the repository at this point in the history
only destroy non-scene objects on server
  • Loading branch information
James-Frowen committed May 4, 2021
1 parent 249f580 commit 5041a06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Mirage/Runtime/ServerObjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ void OnServerStopped()
{
foreach (NetworkIdentity obj in Server.World.SpawnedIdentities.Reverse())
{
if (obj.AssetId != Guid.Empty)
DestroyObject(obj, true);
// Unspawn all, but only destroy non-scene objects on server
DestroyObject(obj, obj.sceneId == 0);
}

Server.World.ClearSpawnedObjects();
Expand Down

0 comments on commit 5041a06

Please sign in to comment.