]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix projectiles (#25636)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Tue, 27 Feb 2024 13:04:32 +0000 (00:04 +1100)
committerGitHub <noreply@github.com>
Tue, 27 Feb 2024 13:04:32 +0000 (00:04 +1100)
Content.Server/Projectiles/ProjectileSystem.cs
Content.Shared/Projectiles/SharedProjectileSystem.cs

index 15ea5936e13921d63c2a57ea1d57765dd0fa530e..0061b16e47c501d8394a9b158dd7b121eb387a7a 100644 (file)
@@ -69,9 +69,6 @@ public sealed class ProjectileSystem : SharedProjectileSystem
 
         component.DamagedEntity = true;
 
-        var afterProjectileHitEvent = new AfterProjectileHitEvent(component.Damage, target, args.OtherFixture);
-        RaiseLocalEvent(uid, ref afterProjectileHitEvent);
-
         if (component.DeleteOnCollide)
             QueueDel(uid);
 
index f57e873653962b71dd6eb4a0959e2ef676984d52..f40a7a0363bab6685cc406bad0c1567b0f59c6b7 100644 (file)
@@ -34,7 +34,6 @@ public abstract partial class SharedProjectileSystem : EntitySystem
         base.Initialize();
 
         SubscribeLocalEvent<ProjectileComponent, PreventCollideEvent>(PreventCollision);
-        SubscribeLocalEvent<ProjectileComponent, AfterProjectileHitEvent>(AfterProjectileHit);
         SubscribeLocalEvent<EmbeddableProjectileComponent, ProjectileHitEvent>(OnEmbedProjectileHit);
         SubscribeLocalEvent<EmbeddableProjectileComponent, ThrowDoHitEvent>(OnEmbedThrowDoHit);
         SubscribeLocalEvent<EmbeddableProjectileComponent, ActivateInWorldEvent>(OnEmbedActivate);
@@ -163,18 +162,6 @@ public abstract partial class SharedProjectileSystem : EntitySystem
     {
         args.Cancel("pacified-cannot-throw-embed");
     }
-
-    /// <summary>
-    /// Checks if the projectile is allowed to penetrate the target it hit.
-    /// </summary>
-    private void AfterProjectileHit(EntityUid uid, ProjectileComponent component, ref AfterProjectileHitEvent args)
-    {
-        //Overrides the original DeleteOnCollide if the projectile passes all penetration checks.
-        //This is to prevent having to set DeleteOnCollide to false on every prototype
-        //you want to give the ability to penetrate entities.
-        if(component.DeleteOnCollide)
-            component.DeleteOnCollide = false;
-    }
 }
 
 [Serializable, NetSerializable]
@@ -201,9 +188,3 @@ public record struct ProjectileReflectAttemptEvent(EntityUid ProjUid, Projectile
 /// </summary>
 [ByRefEvent]
 public record struct ProjectileHitEvent(DamageSpecifier Damage, EntityUid Target, EntityUid? Shooter = null);
-
-/// <summary>
-/// Raised after a projectile has dealt it's damage.
-/// </summary>
-[ByRefEvent]
-public record struct AfterProjectileHitEvent(DamageSpecifier Damage, EntityUid Target, Fixture Fixture);