Fix AlertControl throwing an error if the sprite view entity is deleted multiple times (#27690)

* Fix AlertControl throwing an error if disposed multiple times

* Replace default check with deleted check
This commit is contained in:
DrSmugleaf
2024-05-05 18:38:55 -07:00
committed by GitHub
parent 82fe5ab55d
commit c20df3e39f

View File

@@ -3,7 +3,6 @@ using Content.Client.Actions.UI;
using Content.Client.Cooldown; using Content.Client.Cooldown;
using Content.Shared.Alert; using Content.Shared.Alert;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Shared.Timing; using Robust.Shared.Timing;
@@ -117,7 +116,9 @@ namespace Content.Client.UserInterface.Systems.Alerts.Controls
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); base.Dispose(disposing);
_entityManager.QueueDeleteEntity(_spriteViewEntity);
if (!_entityManager.Deleted(_spriteViewEntity))
_entityManager.QueueDeleteEntity(_spriteViewEntity);
} }
} }