Make more network-events check EntitySessionEventArgs. (#6612)
This commit is contained in:
@@ -7,7 +7,7 @@ using InventoryComponent = Content.Shared.Inventory.InventoryComponent;
|
||||
|
||||
namespace Content.Server.Inventory
|
||||
{
|
||||
class ServerInventorySystem : InventorySystem
|
||||
sealed class ServerInventorySystem : InventorySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -20,11 +20,14 @@ namespace Content.Server.Inventory
|
||||
SubscribeNetworkEvent<OpenSlotStorageNetworkMessage>(OnOpenSlotStorage);
|
||||
}
|
||||
|
||||
private void OnOpenSlotStorage(OpenSlotStorageNetworkMessage ev)
|
||||
private void OnOpenSlotStorage(OpenSlotStorageNetworkMessage ev, EntitySessionEventArgs args)
|
||||
{
|
||||
if (TryGetSlotEntity(ev.Uid, ev.Slot, out var entityUid) && TryComp<ServerStorageComponent>(entityUid, out var storageComponent))
|
||||
if (args.SenderSession.AttachedEntity is not EntityUid { Valid: true } uid)
|
||||
return;
|
||||
|
||||
if (TryGetSlotEntity(uid, ev.Slot, out var entityUid) && TryComp<ServerStorageComponent>(entityUid, out var storageComponent))
|
||||
{
|
||||
storageComponent.OpenStorageUI(ev.Uid);
|
||||
storageComponent.OpenStorageUI(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user