]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Katana Dash checks based on vision rather than collision (#27793)
authorPlykiya <58439124+Plykiya@users.noreply.github.com>
Wed, 8 May 2024 10:21:59 +0000 (03:21 -0700)
committerGitHub <noreply@github.com>
Wed, 8 May 2024 10:21:59 +0000 (20:21 +1000)
* Fix dash check

* unused

* obsolete function

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
Content.Shared/Ninja/Systems/DashAbilitySystem.cs

index f9e5d4a1f63d2691445b05e085701fa29571918d..4853968b61f6d6350b0fc2c5f7fa603b7cbc0c99 100644 (file)
@@ -4,8 +4,8 @@ using Content.Shared.Charges.Systems;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Ninja.Components;
-using Content.Shared.Physics;
 using Content.Shared.Popups;
+using Content.Shared.Examine;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
@@ -20,7 +20,7 @@ public sealed class DashAbilitySystem : EntitySystem
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedChargesSystem _charges = default!;
     [Dependency] private readonly SharedHandsSystem _hands = default!;
-    [Dependency] private readonly SharedInteractionSystem _interaction = default!;
+    [Dependency] private readonly ExamineSystemShared _examine = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly SharedTransformSystem _transform = default!;
     [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
@@ -79,11 +79,10 @@ public sealed class DashAbilitySystem : EntitySystem
             _popup.PopupClient(Loc.GetString("dash-ability-no-charges", ("item", uid)), user, user);
             return;
         }
-
-        var origin = Transform(user).MapPosition;
+        var origin = _transform.GetMapCoordinates(user);
         var target = args.Target.ToMap(EntityManager, _transform);
         // prevent collision with the user duh
-        if (!_interaction.InRangeUnobstructed(origin, target, 0f, CollisionGroup.Opaque, uid => uid == user))
+        if (!_examine.InRangeUnOccluded(origin, target, SharedInteractionSystem.MaxRaycastRange, null))
         {
             // can only dash if the destination is visible on screen
             _popup.PopupClient(Loc.GetString("dash-ability-cant-see", ("item", uid)), user, user);