Fixed a bunch of sprites not being removed
This commit is contained in:
@@ -124,6 +124,8 @@ namespace Barotrauma
|
||||
}
|
||||
set
|
||||
{
|
||||
if (info != null && info != value) info.Remove();
|
||||
|
||||
info = value;
|
||||
if (info != null) info.Character = this;
|
||||
}
|
||||
@@ -1685,6 +1687,8 @@ namespace Barotrauma
|
||||
{
|
||||
base.Remove();
|
||||
|
||||
if (info != null) info.Remove();
|
||||
|
||||
CharacterList.Remove(this);
|
||||
|
||||
if (controlled == this) controlled = null;
|
||||
|
||||
@@ -325,5 +325,10 @@ namespace Barotrauma
|
||||
parentElement.Add(charElement);
|
||||
return charElement;
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
if (headSprite != null) headSprite.Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,6 @@ namespace Barotrauma
|
||||
damagedSpritePath = damagedSpritePath.Replace("[HEADID]", character.Info.HeadSpriteId.ToString());
|
||||
}
|
||||
|
||||
|
||||
damagedSprite = new Sprite(subElement, "", damagedSpritePath);
|
||||
break;
|
||||
case "attack":
|
||||
@@ -546,6 +545,8 @@ namespace Barotrauma
|
||||
public void Remove()
|
||||
{
|
||||
sprite.Remove();
|
||||
if (damagedSprite != null) damagedSprite.Remove();
|
||||
|
||||
body.Remove();
|
||||
|
||||
if (bodyShapeTexture != null)
|
||||
|
||||
Reference in New Issue
Block a user