Skip to content

Commit

Permalink
Update Content.Shared/Cuffs/SharedCuffableSystem.cs
Browse files Browse the repository at this point in the history
Co-authored-by: DEATHB4DEFEAT <[email protected]>
Signed-off-by: Danger Revolution! <[email protected]>
  • Loading branch information
DangerRevolution and DEATHB4DEFEAT committed Jan 31, 2024
1 parent 807308f commit cc49ae9
Showing 1 changed file with 13 additions and 25 deletions.
38 changes: 13 additions & 25 deletions Content.Shared/Cuffs/SharedCuffableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,36 +449,24 @@ public bool TrySpawnCuffSplitStack(EntityUid handcuff, EntityUid user, EntityUid
handcuffsplit = null;
return false;
}
if (TryComp<StackComponent>(handcuff, out var stackComp))
{
if (_stacks.GetCount(handcuff, stackComp) >= 1)
{
_stacks.Use(handcuff, 1, stackComp);

if (_net.IsServer) /// let the server spawn because client mispredicts
{
var pos = Transform(target).Coordinates;
handcuffsplit = Spawn("Zipties", pos); /// This should somehow get the proto ID instead of zipties, but fuck if I know how.
return true;
}
else
{
handcuffsplit = null;
return false;
}
}
else
{
handcuffsplit = null;
return false;
}
}
else
if (!TryComp<StackComponent>(handcuff, out var stackComp))
{
handcuffsplit = handcuff;
_hands.TryDrop(user, handcuff);
return true;
}

if (_stacks.GetCount(handcuff, stackComp) >= 1)
{
_stacks.Use(handcuff, 1, stackComp);

var pos = Transform(target).Coordinates;
handcuffsplit = _net.IsServer ? Spawn("Zipties", pos) : null;
}
else
handcuffsplit = null;

return handcuffsplit != null;
}

/// <summary>
Expand Down

0 comments on commit cc49ae9

Please sign in to comment.