Browse Source

Makes sure if you don't spawn a game object into MissionGroup, it spawns it into MissionCleanup.

Areloch 9 years ago
parent
commit
bbf7865a77

+ 3 - 1
Templates/Full/game/scripts/server/gameObjects/GameObjectManager.cs

@@ -77,8 +77,10 @@ function spawnGameObject(%name, %addToMissionGroup)
    {
       %newSGOObject = TamlRead(%gameObjectAsset.TAMLFilePath);
             
-      if(%addToMissionGroup == true)
+      if(%addToMissionGroup == true) //save instance when saving level
          MissionGroup.add(%newSGOObject);
+      else // clear instance on level exit
+         MissionCleanup.add(%newSGOObject);
          
       return %newSGOObject;
    }