]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix tranquiliser shells not working (#23886)
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Wed, 10 Jan 2024 23:02:37 +0000 (01:02 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Jan 2024 23:02:37 +0000 (18:02 -0500)
* Fix tranquiliser darts not working

Fixes a bug introduced by 9f47079d02a872f0aaff84f4556b83d3c6f835ef which
was made to stop the fly-by fixture from triggering the system. This was
done by checking whether the fixture was hard. Apparently the
projectile's fixture is never hard as well. The change just makes it so
that check only succeeds when the fixture is a fly-by fixture.

* Remove something that I think is redundant

* Remove random using directive that somehow appeared.

* Address Review

* Adress Review 2

* Put the appropriate fixture ids

Content.Server/Chemistry/Components/SolutionInjectOnCollideComponent.cs
Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs
Resources/Prototypes/Entities/Objects/Fun/darts.yml
Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml

index c1d0fec05a77fab291e0c8fb9a4cd9bf4bb261fe..cdba55467ae4ecc633873384d1b37f314a0fe3e2 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.FixedPoint;
 using Content.Shared.Inventory;
+using Content.Shared.Projectiles;
 
 namespace Content.Server.Chemistry.Components;
 
@@ -24,4 +25,7 @@ public sealed partial class SolutionInjectOnCollideComponent : Component
     /// </summary>
     [DataField("blockSlots"), ViewVariables(VVAccess.ReadWrite)]
     public SlotFlags BlockSlots = SlotFlags.MASK;
+
+    [DataField]
+    public string FixtureId = SharedProjectileSystem.ProjectileFixture;
 }
index 446be0ca772b854e8f5082e75d14cf266c40d378..0f696774ae5e69f3153298eae09cf1c43aefac5e 100644 (file)
@@ -26,7 +26,7 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
         var target = args.OtherEntity;
 
         if (!args.OtherBody.Hard ||
-            !args.OurBody.Hard ||
+            args.OurFixtureId != ent.Comp.FixtureId ||
             !EntityManager.TryGetComponent<BloodstreamComponent>(target, out var bloodstream) ||
             !_solutionContainersSystem.TryGetInjectableSolution(ent.Owner, out var solution, out _))
         {
index a4e86e1b113a49f9fccb224bacf5ad81d7fbdf9f..7d91b7fbccc101b7f021ac88b9d62f49a3dcd213 100644 (file)
@@ -55,6 +55,7 @@
   - type: SolutionInjectOnCollide
     transferAmount: 2
     blockSlots: OUTERCLOTHING
+    fixtureId: "throw-fixture"
   - type: SolutionTransfer
     maxTransferAmount: 2
   - type: Damageable
   - type: SolutionInjectOnCollide
     transferAmount: 7
     blockSlots: NONE
+    fixtureId: "throw-fixture"
   - type: SolutionTransfer
     maxTransferAmount: 7
 
index 4dff7f3ee1ed1c6913f9a0dc60447c8057cef2ac..279fed80433fd291c212cb2ec998d4f66775a284 100644 (file)
@@ -67,6 +67,7 @@
     solution: melee
   - type: SolutionInjectOnCollide
     transferAmount: 2
+    fixtureId: "throw-fixture"
     blockSlots: NONE
   - type: SolutionTransfer
     maxTransferAmount: 2