Fix use-in-hand interactions (#7085)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using Content.Server.Atmos;
|
||||
using Content.Server.Clothing.Components;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Server.Temperature.Systems;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using InventoryComponent = Content.Shared.Inventory.InventoryComponent;
|
||||
@@ -17,9 +19,19 @@ namespace Content.Server.Inventory
|
||||
SubscribeLocalEvent<InventoryComponent, LowPressureEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, ModifyChangedTemperatureEvent>(RelayInventoryEvent);
|
||||
|
||||
SubscribeLocalEvent<ClothingComponent, UseInHandEvent>(OnUseInHand);
|
||||
|
||||
SubscribeNetworkEvent<OpenSlotStorageNetworkMessage>(OnOpenSlotStorage);
|
||||
}
|
||||
|
||||
private void OnUseInHand(EntityUid uid, ClothingComponent component, UseInHandEvent args)
|
||||
{
|
||||
if (args.Handled || !component.QuickEquip)
|
||||
return;
|
||||
|
||||
QuickEquip(uid, component, args);
|
||||
}
|
||||
|
||||
private void OnOpenSlotStorage(OpenSlotStorageNetworkMessage ev, EntitySessionEventArgs args)
|
||||
{
|
||||
if (args.SenderSession.AttachedEntity is not EntityUid { Valid: true } uid)
|
||||
|
||||
Reference in New Issue
Block a user