Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnemotechnician committed Feb 10, 2024
1 parent ba46cc6 commit dc65e3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Content.Server/Nyanotrasen/Carrying/CarryingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Content.Server.Popups;
using Content.Server.Contests;
using Content.Server.Item.PseudoItem;
using Content.Server.Storage.EntitySystems;
using Content.Shared.Climbing; // Shared instead of Server
using Content.Shared.Mobs;
using Content.Shared.DoAfter;
Expand Down Expand Up @@ -170,6 +171,9 @@ private void OnMoveInput(EntityUid uid, BeingCarriedComponent component, ref Mov
if (!TryComp<CanEscapeInventoryComponent>(uid, out var escape))
return;

if (args.OldMovement == MoveButtons.None || args.OldMovement == MoveButtons.Walk)
return; // Don't try to escape if not moving *cries*

if (_actionBlockerSystem.CanInteract(uid, component.Carrier))
{
_escapeInventorySystem.AttemptEscape(uid, component.Carrier, escape, _contests.MassContest(uid, component.Carrier));
Expand Down Expand Up @@ -381,15 +385,15 @@ private void AddInsertCarriedVerb(EntityUid uid, CarryingComponent component, Ge
if (toInsert is not { Valid: true } || !args.CanAccess || !TryComp<PseudoItemComponent>(toInsert, out var pseudoItem))
return;

if (!TryComp<StorageComponent>(args.Target, out var storage) || storage.StorageUsed + pseudoItem.Size > storage.StorageCapacityMax)
return;
if (!HasComp<StorageComponent>(args.Target))
return; // Can't check if the person would actually fit here

InnateVerb verb = new()
{
Act = () =>
{
DropCarried(uid, toInsert.Value);
_pseudoItem.TryInsert(args.Target, toInsert.Value, pseudoItem, storage);
_pseudoItem.TryInsert(args.Target, toInsert.Value, args.User, pseudoItem);
},
Text = Loc.GetString("action-name-insert-other", ("target", toInsert)),
Priority = 2
Expand Down
6 changes: 5 additions & 1 deletion Content.Server/Resist/EscapeInventorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Content.Server.Storage.Components;
using Content.Server.Carrying;
using Content.Shared.Actions;
using Content.Shared.Movement.Systems;
using Robust.Shared.Prototypes;

namespace Content.Server.Resist;
Expand Down Expand Up @@ -57,6 +58,9 @@ private void OnRelayMovement(EntityUid uid, CanEscapeInventoryComponent componen
if (!_containerSystem.TryGetContainingContainer(uid, out var container) || !_actionBlockerSystem.CanInteract(uid, container.Owner))
return;

if (args.OldMovement == MoveButtons.None || args.OldMovement == MoveButtons.Walk)
return; // This event gets fired when the user holds down shift, which makes no sense

// Contested
if (_handsSystem.IsHolding(container.Owner, uid, out var inHand))
{
Expand Down Expand Up @@ -96,7 +100,7 @@ private void OnRelayMovement(EntityUid uid, CanEscapeInventoryComponent componen
if (!_doAfterSystem.TryStartDoAfter(doAfterEventArgs, out component.DoAfter))
return;

Dirty(user, component);
//Dirty(user, component);
_popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-start-resisting"), user, user);
_popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-start-resisting-target"), container, container);

Expand Down

0 comments on commit dc65e3d

Please sign in to comment.