Add methods to transfer actions between containers (#20901)
This commit is contained in:
@@ -586,9 +586,16 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
if (!ResolveActionData(actionId, ref action))
|
||||
return;
|
||||
|
||||
if (action.AttachedEntity != performer)
|
||||
{
|
||||
Log.Error($"Attempted to remove an action {ToPrettyString(actionId)} from an entity that it was never attached to: {ToPrettyString(performer)}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Resolve(performer, ref comp, false))
|
||||
{
|
||||
DebugTools.AssertNull(action.AttachedEntity);
|
||||
DebugTools.Assert(action.AttachedEntity == null || TerminatingOrDeleted(action.AttachedEntity.Value));
|
||||
action.AttachedEntity = null;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -599,7 +606,6 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
DebugTools.Assert(action.AttachedEntity == performer);
|
||||
comp.Actions.Remove(actionId.Value);
|
||||
action.AttachedEntity = null;
|
||||
Dirty(actionId.Value, action);
|
||||
|
||||
Reference in New Issue
Block a user