mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-16 21:17:39 +03:00
[Fix] Torso Cavity Being Accessible (#300)
rezal uristov na lokalke 10 chasov Co-authored-by: vanx <discord@vanxxxx>
This commit is contained in:
@@ -16,6 +16,7 @@ using Robust.Shared.Utility;
|
||||
using Content.Shared._Shitmed.Body.Events;
|
||||
using Content.Shared._Shitmed.Body.Part;
|
||||
using Content.Shared._Shitmed.BodyEffects;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Random;
|
||||
@@ -52,6 +53,9 @@ public partial class SharedBodySystem
|
||||
// This seems to be an issue due to wiz-merge, on my old branch it was properly instantiating
|
||||
// ItemInsertionSlot's container on both ends. It does show up properly on ItemSlotsComponent though.
|
||||
_slots.AddItemSlot(ent, ent.Comp.ContainerName, ent.Comp.ItemInsertionSlot);
|
||||
|
||||
_slots.SetLock(ent.Owner, ent.Comp.ItemInsertionSlot, true); // WWDP prevent inserting items into torsos without surgery
|
||||
|
||||
Dirty(ent, ent.Comp);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ using Content.Shared.Popups;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Toolshed.TypeParsers;
|
||||
using System.Linq;
|
||||
using Content.Shared.Inventory.VirtualItem;
|
||||
|
||||
|
||||
namespace Content.Shared._Shitmed.Medical.Surgery;
|
||||
|
||||
@@ -396,15 +398,20 @@ public abstract partial class SharedSurgerySystem
|
||||
if (!TryComp(args.Part, out BodyPartComponent? partComp) || partComp.PartType != BodyPartType.Torso)
|
||||
return;
|
||||
|
||||
_itemSlotsSystem.SetLock(args.Part, partComp.ItemInsertionSlot, false); // WWDP prevent inserting items into torsos without surgery
|
||||
|
||||
var activeHandEntity = _hands.EnumerateHeld(args.User).FirstOrDefault();
|
||||
if (activeHandEntity != default
|
||||
&& ent.Comp.Action == "Insert"
|
||||
&& !HasComp<VirtualItemComponent>(activeHandEntity) // WWDP prevent trying to insert virtual items
|
||||
&& TryComp(activeHandEntity, out ItemComponent? itemComp)
|
||||
&& (itemComp.Size.Id == "Tiny"
|
||||
|| itemComp.Size.Id == "Small"))
|
||||
_itemSlotsSystem.TryInsert(ent, partComp.ItemInsertionSlot, activeHandEntity, args.User);
|
||||
else if (ent.Comp.Action == "Remove")
|
||||
_itemSlotsSystem.TryEjectToHands(ent, partComp.ItemInsertionSlot, args.User);
|
||||
|
||||
_itemSlotsSystem.SetLock(args.Part, partComp.ItemInsertionSlot, true); // WWDP prevent inserting items into torsos without surgery
|
||||
}
|
||||
|
||||
private void OnCavityCheck(Entity<SurgeryStepCavityEffectComponent> ent, ref SurgeryStepCompleteCheckEvent args)
|
||||
|
||||
Reference in New Issue
Block a user