Fix tranquiliser shells not working (#23886)

* Fix tranquiliser darts not working

Fixes a bug introduced by 9f47079d02 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
This commit is contained in:
nikthechampiongr
2024-01-11 01:02:37 +02:00
committed by GitHub
parent 1fbb63f7d3
commit ef132c8a7b
4 changed files with 8 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.Projectiles;
namespace Content.Server.Chemistry.Components; namespace Content.Server.Chemistry.Components;
@@ -24,4 +25,7 @@ public sealed partial class SolutionInjectOnCollideComponent : Component
/// </summary> /// </summary>
[DataField("blockSlots"), ViewVariables(VVAccess.ReadWrite)] [DataField("blockSlots"), ViewVariables(VVAccess.ReadWrite)]
public SlotFlags BlockSlots = SlotFlags.MASK; public SlotFlags BlockSlots = SlotFlags.MASK;
[DataField]
public string FixtureId = SharedProjectileSystem.ProjectileFixture;
} }

View File

@@ -26,7 +26,7 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
var target = args.OtherEntity; var target = args.OtherEntity;
if (!args.OtherBody.Hard || if (!args.OtherBody.Hard ||
!args.OurBody.Hard || args.OurFixtureId != ent.Comp.FixtureId ||
!EntityManager.TryGetComponent<BloodstreamComponent>(target, out var bloodstream) || !EntityManager.TryGetComponent<BloodstreamComponent>(target, out var bloodstream) ||
!_solutionContainersSystem.TryGetInjectableSolution(ent.Owner, out var solution, out _)) !_solutionContainersSystem.TryGetInjectableSolution(ent.Owner, out var solution, out _))
{ {

View File

@@ -55,6 +55,7 @@
- type: SolutionInjectOnCollide - type: SolutionInjectOnCollide
transferAmount: 2 transferAmount: 2
blockSlots: OUTERCLOTHING blockSlots: OUTERCLOTHING
fixtureId: "throw-fixture"
- type: SolutionTransfer - type: SolutionTransfer
maxTransferAmount: 2 maxTransferAmount: 2
- type: Damageable - type: Damageable
@@ -125,6 +126,7 @@
- type: SolutionInjectOnCollide - type: SolutionInjectOnCollide
transferAmount: 7 transferAmount: 7
blockSlots: NONE blockSlots: NONE
fixtureId: "throw-fixture"
- type: SolutionTransfer - type: SolutionTransfer
maxTransferAmount: 7 maxTransferAmount: 7

View File

@@ -67,6 +67,7 @@
solution: melee solution: melee
- type: SolutionInjectOnCollide - type: SolutionInjectOnCollide
transferAmount: 2 transferAmount: 2
fixtureId: "throw-fixture"
blockSlots: NONE blockSlots: NONE
- type: SolutionTransfer - type: SolutionTransfer
maxTransferAmount: 2 maxTransferAmount: 2