Fix not being able to put most things in your pockets.
This commit is contained in:
@@ -107,11 +107,6 @@ namespace Content.Server.Clothing.Components
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EquipSound != null)
|
|
||||||
{
|
|
||||||
SoundSystem.Play(Filter.Pvs(Owner), EquipSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ using Content.Shared.Verbs;
|
|||||||
using Robust.Server.Console;
|
using Robust.Server.Console;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Console;
|
using Robust.Shared.Console;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
@@ -27,6 +28,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
using static Content.Shared.Inventory.EquipmentSlotDefines;
|
using static Content.Shared.Inventory.EquipmentSlotDefines;
|
||||||
@@ -262,6 +264,13 @@ namespace Content.Server.Inventory.Components
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Make clothing component not inherit ItemComponent, for fuck's sake.
|
||||||
|
// TODO: Make clothing component not required for playing a sound on equip... Move it to its own component.
|
||||||
|
if (item is ClothingComponent { EquipSound: {} equipSound })
|
||||||
|
{
|
||||||
|
SoundSystem.Play(Filter.Pvs(Owner), equipSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
|
||||||
|
}
|
||||||
|
|
||||||
_entitySystemManager.GetEntitySystem<InteractionSystem>().EquippedInteraction(Owner, item.Owner, slot);
|
_entitySystemManager.GetEntitySystem<InteractionSystem>().EquippedInteraction(Owner, item.Owner, slot);
|
||||||
|
|
||||||
OnItemChanged?.Invoke();
|
OnItemChanged?.Invoke();
|
||||||
@@ -520,10 +529,14 @@ namespace Content.Server.Inventory.Components
|
|||||||
var hands = Owner.GetComponent<HandsComponent>();
|
var hands = Owner.GetComponent<HandsComponent>();
|
||||||
var activeHand = hands.ActiveHand;
|
var activeHand = hands.ActiveHand;
|
||||||
var activeItem = hands.GetActiveHand;
|
var activeItem = hands.GetActiveHand;
|
||||||
if (activeHand != null && activeItem != null && activeItem.Owner.TryGetComponent(out ClothingComponent? clothing))
|
if (activeHand != null && activeItem != null && activeItem.Owner.TryGetComponent(out ItemComponent? item))
|
||||||
{
|
{
|
||||||
hands.TryDropNoInteraction();
|
hands.TryDropNoInteraction();
|
||||||
clothing.TryEquip(this, msg.Inventoryslot, Owner);
|
if (!Equip(msg.Inventoryslot, item, true, out var reason))
|
||||||
|
{
|
||||||
|
hands.PutInHand(item);
|
||||||
|
Owner.PopupMessageCursor(reason);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
4
Resources/Changelog/Parts/clothing.yml
Normal file
4
Resources/Changelog/Parts/clothing.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Zumorica
|
||||||
|
changes:
|
||||||
|
- type: Fix
|
||||||
|
message: Fix bug which prevented players from equipping most items in their pockets.
|
||||||
Reference in New Issue
Block a user