Commands for adding and removing actions (#38317)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user