Entity removal fixes

This commit is contained in:
Regalis
2016-11-14 17:52:26 +02:00
parent b86231170f
commit 335bf00890
5 changed files with 44 additions and 7 deletions
+21 -4
View File
@@ -557,12 +557,29 @@ namespace Barotrauma
public void Remove()
{
sprite.Remove();
if (LightSource != null) LightSource.Remove();
if (damagedSprite != null) damagedSprite.Remove();
sprite = null;
body.Remove();
if (LightSource != null)
{
LightSource.Remove();
}
if (damagedSprite != null)
{
damagedSprite.Remove();
damagedSprite = null;
}
if (hitSound != null) hitSound.Remove();
if (body != null)
{
body.Remove();
body = null;
}
if (hitSound != null)
{
hitSound.Remove();
hitSound = null;
}
}
}
}