]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix debug assert when shooting guns (#21070)
authorDrSmugleaf <DrSmugleaf@users.noreply.github.com>
Wed, 18 Oct 2023 04:45:35 +0000 (21:45 -0700)
committerGitHub <noreply@github.com>
Wed, 18 Oct 2023 04:45:35 +0000 (15:45 +1100)
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Emitter.cs
Content.Server/Projectiles/ProjectileSystem.cs
Content.Server/Singularity/EntitySystems/EmitterSystem.cs
Content.Server/Weapons/Ranged/Systems/GunSystem.cs
Content.Shared/Projectiles/SharedProjectileSystem.cs

index dbe55bb6e5c19a67eaac5e4b62f42549f4ae708d..7fad69e349f4dff5dac7650453655d669dd056c4 100644 (file)
@@ -38,7 +38,7 @@ public sealed partial class ParticleAcceleratorSystem
         }
 
         if (TryComp<ProjectileComponent>(emitted, out var proj))
-            _projectileSystem.SetShooter(proj, uid);
+            _projectileSystem.SetShooter(emitted, proj, uid);
 
         if (TryComp<SinguloFoodComponent>(emitted, out var food))
         {
index c52e712e741b74aaf69831a8a9998842a7a96c39..b8a6b8c5b262e2edea00d1151aa6debecb3737f7 100644 (file)
@@ -4,11 +4,10 @@ using Content.Server.Weapons.Ranged.Systems;
 using Content.Shared.Camera;
 using Content.Shared.Damage;
 using Content.Shared.Database;
-using Content.Shared.FixedPoint;
 using Content.Shared.Projectiles;
 using Robust.Server.GameObjects;
-using Robust.Shared.Player;
 using Robust.Shared.Physics.Events;
+using Robust.Shared.Player;
 
 namespace Content.Server.Projectiles;
 
@@ -39,7 +38,7 @@ public sealed class ProjectileSystem : SharedProjectileSystem
         RaiseLocalEvent(target, ref attemptEv);
         if (attemptEv.Cancelled)
         {
-            SetShooter(component, target);
+            SetShooter(uid, component, target);
             return;
         }
 
index e737cd0a8d72c25496d23689e99935bc544d8ca0..652ca236e441110eff08686e3eed6e9fbd432670 100644 (file)
@@ -291,7 +291,7 @@ namespace Content.Server.Singularity.EntitySystems
             var xform = Transform(uid);
             var ent = Spawn(component.BoltType, xform.Coordinates);
             var proj = EnsureComp<ProjectileComponent>(ent);
-            _projectile.SetShooter(proj, uid);
+            _projectile.SetShooter(ent, proj, uid);
 
             var targetPos = new EntityCoordinates(uid, new Vector2(0, -1));
 
index adda6a94e3c123c7fe5915c989f4d37331a56643..bbac7acd125d7c39932192fe3505136d03980b94 100644 (file)
@@ -10,13 +10,13 @@ using Content.Shared.Damage;
 using Content.Shared.Damage.Systems;
 using Content.Shared.Database;
 using Content.Shared.Effects;
-using Content.Shared.FixedPoint;
 using Content.Shared.Interaction.Components;
 using Content.Shared.Projectiles;
 using Content.Shared.Weapons.Melee;
 using Content.Shared.Weapons.Ranged;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Events;
+using Content.Shared.Weapons.Ranged.Systems;
 using Content.Shared.Weapons.Reflect;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
@@ -26,7 +26,6 @@ using Robust.Shared.Physics.Components;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
-using SharedGunSystem = Content.Shared.Weapons.Ranged.Systems.SharedGunSystem;
 
 namespace Content.Server.Weapons.Ranged.Systems;
 
@@ -305,7 +304,7 @@ public sealed partial class GunSystem : SharedGunSystem
         if (user != null)
         {
             var projectile = EnsureComp<ProjectileComponent>(uid);
-            Projectiles.SetShooter(projectile, user.Value);
+            Projectiles.SetShooter(uid, projectile, user.Value);
             projectile.Weapon = gunUid;
         }
 
index 1df743bc0b1d2e6d6573b67e638c9c1573ead410..63b4cb13aa634e7ff79cb36a93ce7fd89c35180a 100644 (file)
@@ -3,11 +3,7 @@ using Content.Shared.Damage;
 using Content.Shared.DoAfter;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
-using Content.Shared.Projectiles;
-using Content.Shared.Sound.Components;
 using Content.Shared.Throwing;
-using Content.Shared.Weapons.Ranged.Components;
-using Robust.Shared.Audio;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Physics;
@@ -139,13 +135,13 @@ public abstract partial class SharedProjectileSystem : EntitySystem
         }
     }
 
-    public void SetShooter(ProjectileComponent component, EntityUid uid)
+    public void SetShooter(EntityUid id, ProjectileComponent component, EntityUid shooterId)
     {
-        if (component.Shooter == uid)
+        if (component.Shooter == shooterId)
             return;
 
-        component.Shooter = uid;
-        Dirty(uid, component);
+        component.Shooter = shooterId;
+        Dirty(id, component);
     }
 
     [Serializable, NetSerializable]