Fix action state handling bug (#25395)
* Rejig action state handling * Fix entity arg * Fix deserialization
This commit is contained in:
@@ -170,12 +170,7 @@ public sealed class ToggleableClothingSystem : EntitySystem
|
||||
// "outside" of the container or not. This means that if a hardsuit takes too much damage, the helmet will also
|
||||
// automatically be deleted.
|
||||
|
||||
// remove action.
|
||||
if (_actionsSystem.TryGetActionData(component.ActionEntity, out var action) &&
|
||||
action.AttachedEntity != null)
|
||||
{
|
||||
_actionsSystem.RemoveAction(action.AttachedEntity.Value, component.ActionEntity);
|
||||
}
|
||||
_actionsSystem.RemoveAction(component.ActionEntity);
|
||||
|
||||
if (component.ClothingUid != null && !_netMan.IsClient)
|
||||
QueueDel(component.ClothingUid.Value);
|
||||
@@ -199,13 +194,7 @@ public sealed class ToggleableClothingSystem : EntitySystem
|
||||
if (toggleComp.LifeStage > ComponentLifeStage.Running)
|
||||
return;
|
||||
|
||||
// remove action.
|
||||
if (_actionsSystem.TryGetActionData(toggleComp.ActionEntity, out var action) &&
|
||||
action.AttachedEntity != null)
|
||||
{
|
||||
_actionsSystem.RemoveAction(action.AttachedEntity.Value, toggleComp.ActionEntity);
|
||||
}
|
||||
|
||||
_actionsSystem.RemoveAction(toggleComp.ActionEntity);
|
||||
RemComp(component.AttachedUid, toggleComp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user