Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tranq Rounds Injecting When Deflected #22

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,4 @@ public sealed partial class SolutionInjectOnCollideComponent : Component
/// </summary>
[DataField("blockSlots"), ViewVariables(VVAccess.ReadWrite)]
public SlotFlags BlockSlots = SlotFlags.MASK;

[DataField]
public string FixtureId = SharedProjectileSystem.ProjectileFixture;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
using Content.Server.Chemistry.Components;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared.Inventory;
using JetBrains.Annotations;
using Robust.Shared.Physics.Events;
using Content.Shared.Projectiles;

namespace Content.Server.Chemistry.EntitySystems;

Expand All @@ -17,17 +16,15 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SolutionInjectOnCollideComponent, StartCollideEvent>(HandleInjection);
SubscribeLocalEvent<SolutionInjectOnCollideComponent, ProjectileHitEvent>(HandleInjection);
}

private void HandleInjection(Entity<SolutionInjectOnCollideComponent> ent, ref StartCollideEvent args)
private void HandleInjection(Entity<SolutionInjectOnCollideComponent> ent, ref ProjectileHitEvent args)
{
var component = ent.Comp;
var target = args.OtherEntity;
var target = args.Target;

if (!args.OtherBody.Hard ||
args.OurFixtureId != ent.Comp.FixtureId ||
!EntityManager.TryGetComponent<BloodstreamComponent>(target, out var bloodstream) ||
if (!TryComp<BloodstreamComponent>(target, out var bloodstream) ||
!_solutionContainersSystem.TryGetInjectableSolution(ent.Owner, out var solution, out _))
{
return;
Expand Down
Loading