Skip to content

Commit

Permalink
Requests
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN committed Nov 10, 2024
1 parent ae4f085 commit f6a8ce0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Content.Server/Projectiles/ProjectileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Shared.Projectiles;
using Robust.Shared.Physics.Events;
using Robust.Shared.Player;
using Robust.Shared.Random;

namespace Content.Server.Projectiles;

Expand All @@ -18,11 +19,10 @@ public sealed class ProjectileSystem : SharedProjectileSystem
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly GunSystem _guns = default!;
[Dependency] private readonly SharedCameraRecoilSystem _sharedCameraRecoil = default!;
[Dependency] private readonly IRobustRandom _random = default!;

private EntityQuery<PenetratableComponent> _penetratableQuery;

private Random _random = new();

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -73,7 +73,7 @@ private void OnStartCollide(EntityUid uid, ProjectileComponent component, ref St
_sharedCameraRecoil.KickCamera(target, direction);
}

// Corvax-Next-Penetration
// Corvax-Next-Penetration-Start
if (component.PenetrationScore > 0
&& _penetratableQuery.TryGetComponent(target, out var penetratable)
&& _random.Next(component.PenetrationScore + penetratable.StoppingPower) >= penetratable.StoppingPower)
Expand All @@ -87,6 +87,7 @@ private void OnStartCollide(EntityUid uid, ProjectileComponent component, ref St

if (component.DeleteOnCollide && component.DamagedEntity)
QueueDel(uid);
// Corvax-Next-Penetration-End

if (component.ImpactEffect != null && TryComp(uid, out TransformComponent? xform))
{
Expand Down

0 comments on commit f6a8ce0

Please sign in to comment.