Commands for adding and removing actions (#38317)

This commit is contained in:
ScarKy0
2025-06-16 12:25:44 +02:00
committed by GitHub
parent 00b68d4c10
commit 4cc6cb95dc
5 changed files with 195 additions and 0 deletions

View File

@@ -1019,4 +1019,17 @@ public abstract class SharedActionsSystem : EntitySystem
// TODO: Check for charge recovery timer
return action.Cooldown.HasValue && action.Cooldown.Value.End > curTime;
}
/// <summary>
/// Marks the action as temporary.
/// Temporary actions get deleted upon being removed from an entity.
/// </summary>
public void SetTemporary(Entity<ActionComponent?> ent, bool temporary)
{
if (!Resolve(ent.Owner, ref ent.Comp, false))
return;
ent.Comp.Temporary = temporary;
Dirty(ent);
}
}