]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix meteor's ArithmeticException (#33556)
authorWinkarst <74284083+Winkarst-cpu@users.noreply.github.com>
Thu, 5 Dec 2024 12:20:27 +0000 (15:20 +0300)
committerGitHub <noreply@github.com>
Thu, 5 Dec 2024 12:20:27 +0000 (13:20 +0100)
Co-authored-by: Winkarst <74284083+Winkarst-cpu@users.noreply.github.co>
Content.Server/Projectiles/ProjectileSystem.cs

index 970536f42b02728157f590d0bc23a826a2aa2922..5cbc56b8fbc75bfe7f59ab4424c98a3683fef1d7 100644 (file)
@@ -45,7 +45,6 @@ public sealed class ProjectileSystem : SharedProjectileSystem
         RaiseLocalEvent(uid, ref ev);
 
         var otherName = ToPrettyString(target);
-        var direction = args.OurBody.LinearVelocity.Normalized();
         var modifiedDamage = _damageableSystem.TryChangeDamage(target, ev.Damage, component.IgnoreResistances, origin: component.Shooter);
         var deleted = Deleted(target);
 
@@ -64,7 +63,9 @@ public sealed class ProjectileSystem : SharedProjectileSystem
         if (!deleted)
         {
             _guns.PlayImpactSound(target, modifiedDamage, component.SoundHit, component.ForceSound);
-            _sharedCameraRecoil.KickCamera(target, direction);
+
+            if (!args.OurBody.LinearVelocity.IsLengthZero())
+                _sharedCameraRecoil.KickCamera(target, args.OurBody.LinearVelocity.Normalized());
         }
 
         component.DamagedEntity = true;