You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: ServerDestroySpawnedSceneObjects throws an exception before switching scene (#618)
* fix: crash during scene transition
If you have in-scene placed NetworkObjects and you transition to a new scene then a crash will occur in NetworkSpawnManager.ServerDestroySpawnedSceneObjects due to NetworkObjects being removed from the SpawnedObjectsList during the "OnDestroy" invocation. This fixes that crash.
* style: comments and standards
Adding some comments as to why the code is added, camelCase for locals, and generic Var as opposed to specific type for declaration.
* refactor: comments and better approach
This applies a better approach to the issue of removing objects from a list that is being iterated over without throwing the "Collection was modified; enumeration operation may not execute" exception due to NetworkObjects removing themselves from the SpawnedObjectList during OnDestroy.
* refactor: comment
Minor tweak to the comment as to why the code was added.
0 commit comments