stealth clothing (#19397)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -20,6 +20,11 @@ public sealed class GetItemActionsEvent : EntityEventArgs
|
||||
{
|
||||
public SortedSet<ActionType> Actions = new();
|
||||
|
||||
/// <summary>
|
||||
/// User equipping the item.
|
||||
/// </summary>
|
||||
public EntityUid User;
|
||||
|
||||
/// <summary>
|
||||
/// Slot flags for the inventory slot that this item got equipped to. Null if not in a slot (i.e., if equipped to hands).
|
||||
/// </summary>
|
||||
@@ -30,8 +35,9 @@ public sealed class GetItemActionsEvent : EntityEventArgs
|
||||
/// </summary>
|
||||
public bool InHands => SlotFlags == null;
|
||||
|
||||
public GetItemActionsEvent(SlotFlags? slotFlags = null)
|
||||
public GetItemActionsEvent(EntityUid user, SlotFlags? slotFlags = null)
|
||||
{
|
||||
User = user;
|
||||
SlotFlags = slotFlags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
#region EquipHandlers
|
||||
private void OnDidEquip(EntityUid uid, ActionsComponent component, DidEquipEvent args)
|
||||
{
|
||||
var ev = new GetItemActionsEvent(args.SlotFlags);
|
||||
var ev = new GetItemActionsEvent(args.Equipee, args.SlotFlags);
|
||||
RaiseLocalEvent(args.Equipment, ev);
|
||||
|
||||
if (ev.Actions.Count == 0)
|
||||
@@ -421,7 +421,7 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
|
||||
private void OnHandEquipped(EntityUid uid, ActionsComponent component, DidEquipHandEvent args)
|
||||
{
|
||||
var ev = new GetItemActionsEvent();
|
||||
var ev = new GetItemActionsEvent(args.User);
|
||||
RaiseLocalEvent(args.Equipped, ev);
|
||||
|
||||
if (ev.Actions.Count == 0)
|
||||
|
||||
Reference in New Issue
Block a user