Skip to content

Commit 5d48f4b

Browse files
TwoTenPvPrivFox
andauthored
fix: Fix destroying object with custom handlers (#339)
* Fix destroying object with custom handlers * fix: Proper fix Co-authored-by: Bartłomiej Jarosz <[email protected]>
1 parent 8768a6e commit 5d48f4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MLAPI/Spawning/SpawnManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ internal static void ServerResetShudownStateForSceneObjects()
517517

518518
internal static void ServerDestroySpawnedSceneObjects()
519519
{
520-
for (int i = 0; i < SpawnedObjectsList.Count; i++)
520+
for (int i = SpawnedObjectsList.Count - 1; i >= 0; i--)
521521
{
522522
if ((SpawnedObjectsList[i].IsSceneObject != null && SpawnedObjectsList[i].IsSceneObject == true) || SpawnedObjectsList[i].DestroyWithScene)
523523
{

0 commit comments

Comments
 (0)