From: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com> Date: Wed, 10 Jan 2024 23:02:37 +0000 (+0200) Subject: Fix tranquiliser shells not working (#23886) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=ef132c8a7b83691ab550e1cfe5d31fd8be2b3788;p=space-station-14.git Fix tranquiliser shells not working (#23886) * 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 --- diff --git a/Content.Server/Chemistry/Components/SolutionInjectOnCollideComponent.cs b/Content.Server/Chemistry/Components/SolutionInjectOnCollideComponent.cs index c1d0fec05a..cdba55467a 100644 --- a/Content.Server/Chemistry/Components/SolutionInjectOnCollideComponent.cs +++ b/Content.Server/Chemistry/Components/SolutionInjectOnCollideComponent.cs @@ -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 /// [DataField("blockSlots"), ViewVariables(VVAccess.ReadWrite)] public SlotFlags BlockSlots = SlotFlags.MASK; + + [DataField] + public string FixtureId = SharedProjectileSystem.ProjectileFixture; } diff --git a/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs index 446be0ca77..0f696774ae 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs @@ -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(target, out var bloodstream) || !_solutionContainersSystem.TryGetInjectableSolution(ent.Owner, out var solution, out _)) { diff --git a/Resources/Prototypes/Entities/Objects/Fun/darts.yml b/Resources/Prototypes/Entities/Objects/Fun/darts.yml index a4e86e1b11..7d91b7fbcc 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/darts.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/darts.yml @@ -55,6 +55,7 @@ - type: SolutionInjectOnCollide transferAmount: 2 blockSlots: OUTERCLOTHING + fixtureId: "throw-fixture" - type: SolutionTransfer maxTransferAmount: 2 - type: Damageable @@ -125,6 +126,7 @@ - type: SolutionInjectOnCollide transferAmount: 7 blockSlots: NONE + fixtureId: "throw-fixture" - type: SolutionTransfer maxTransferAmount: 7 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml index 4dff7f3ee1..279fed8043 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml @@ -67,6 +67,7 @@ solution: melee - type: SolutionInjectOnCollide transferAmount: 2 + fixtureId: "throw-fixture" blockSlots: NONE - type: SolutionTransfer maxTransferAmount: 2