All remaining physics bodies are removed at the end of submarine unloading (freeing debug bodyShapeTextures, etc). -> LevelTrigger bodies don't have to be removed separately during unloading
This commit is contained in:
@@ -65,7 +65,11 @@ namespace Barotrauma
|
||||
Circle, Rectangle, Capsule
|
||||
};
|
||||
|
||||
public static List<PhysicsBody> list = new List<PhysicsBody>();
|
||||
private static List<PhysicsBody> list = new List<PhysicsBody>();
|
||||
public static List<PhysicsBody> List
|
||||
{
|
||||
get { return list; }
|
||||
}
|
||||
|
||||
//the farseer physics body of the item
|
||||
private Body body;
|
||||
@@ -534,6 +538,15 @@ namespace Barotrauma
|
||||
DisposeProjSpecific();
|
||||
}
|
||||
|
||||
public static void RemoveAll()
|
||||
{
|
||||
for (int i = list.Count - 1; i >= 0; i--)
|
||||
{
|
||||
list[i].Remove();
|
||||
}
|
||||
System.Diagnostics.Debug.Assert(list.Count == 0);
|
||||
}
|
||||
|
||||
partial void DisposeProjSpecific();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user