]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix ninja no guns (#20184)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Fri, 15 Sep 2023 03:12:14 +0000 (04:12 +0100)
committerGitHub <noreply@github.com>
Fri, 15 Sep 2023 03:12:14 +0000 (23:12 -0400)
Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Shared/Weapons/Ranged/Events/ShotAttemptedEvent.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs

index 2b5628f751edf2e9fdda4a703388b226bbbde009..40925ad614c943a32706fa4cb8efb578a54f64c0 100644 (file)
@@ -12,6 +12,11 @@ public record struct ShotAttemptedEvent
     /// </summary>
     public EntityUid User;
 
+    /// <summary>
+    /// The gun being shot.
+    /// </summary>
+    public EntityUid Used;
+
     public bool Cancelled { get; private set; }
 
     /// </summary>
index 5ef51121527c8b2f6889205f5d3f2dc4b988b10c..1c80f73ad6d6fa665154df193cd77212b31d8ec3 100644 (file)
@@ -226,12 +226,17 @@ public abstract partial class SharedGunSystem : EntitySystem
         // check if anything wants to prevent shooting
         var prevention = new ShotAttemptedEvent
         {
-            User = user
+            User = user,
+            Used = gunUid
         };
         RaiseLocalEvent(gunUid, ref prevention);
         if (prevention.Cancelled)
             return;
 
+        RaiseLocalEvent(user, ref prevention);
+        if (prevention.Cancelled)
+            return;
+
         // Need to do this to play the clicking sound for empty automatic weapons
         // but not play anything for burst fire.
         if (gun.NextFire > curTime)