]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix for #22516 - mobs can no longer cause clumsy mobs to get hurt on tables (#22684)
authorJ. Brown <DrMelon@users.noreply.github.com>
Thu, 21 Dec 2023 15:18:26 +0000 (15:18 +0000)
committerGitHub <noreply@github.com>
Thu, 21 Dec 2023 15:18:26 +0000 (10:18 -0500)
Fix for 22516 - mobs can no longer cause other mobs to be bonked against tables.

Content.Shared/Climbing/Systems/BonkSystem.cs
Content.Shared/Climbing/Systems/ClimbSystem.cs

index b18d54cf788f338f4b6d1a8ed70c5e8c2fd6e96f..5eff90b09ddf007db6a7d0160d12307e7162635e 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Climbing.Components;
 using Content.Shared.Damage;
 using Content.Shared.DoAfter;
 using Content.Shared.DragDrop;
+using Content.Shared.Hands.Components;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
 using Content.Shared.Interaction.Components;
@@ -35,7 +36,7 @@ public sealed partial class BonkSystem : EntitySystem
 
     private void OnBonkDoAfter(EntityUid uid, Components.BonkableComponent component, BonkDoAfterEvent args)
     {
-        if (args.Handled || args.Cancelled || args.Args.Target == null)
+        if (args.Handled || args.Cancelled || args.Args.Target == null || args.Args.Target != args.Args.User)
             return;
 
         TryBonk(args.Args.User, uid, component);
@@ -76,7 +77,7 @@ public sealed partial class BonkSystem : EntitySystem
 
     private void OnDragDrop(EntityUid uid, Components.BonkableComponent component, ref DragDropTargetEvent args)
     {
-        if (args.Handled || !HasComp<ClumsyComponent>(args.Dragged))
+        if (args.Handled || !HasComp<ClumsyComponent>(args.Dragged) || !HasComp<HandsComponent>(args.User))
             return;
 
         var doAfterArgs = new DoAfterArgs(EntityManager, args.Dragged, component.BonkDelay, new BonkDoAfterEvent(), uid, target: uid)
index 6f6672e9510bfdfa50be28eafc9ec3750d51c6ea..081fb7fd8c4a1f050c4ccf79ad059e4c87d7f4df 100644 (file)
@@ -163,11 +163,16 @@ public sealed partial class ClimbSystem : VirtualController
          if (args.Handled)
              return;
 
+
          var canVault = args.User == args.Dragged
              ? CanVault(component, args.User, uid, out _)
              : CanVault(component, args.User, args.Dragged, uid, out _);
 
          args.CanDrop = canVault;
+
+         if (!HasComp<HandsComponent>(args.User))
+             args.CanDrop = false;
+
          args.Handled = true;
      }
 
@@ -189,9 +194,7 @@ public sealed partial class ClimbSystem : VirtualController
 
      private void OnClimbableDragDrop(EntityUid uid, ClimbableComponent component, ref DragDropTargetEvent args)
      {
-         // definitely a better way to check if two entities are equal
-         // but don't have computer access and i have to do this without syntax
-         if (args.Handled || args.User != args.Dragged && !HasComp<HandsComponent>(args.User))
+         if (args.Handled)
              return;
 
          TryClimb(args.User, args.Dragged, uid, out _, component);