Fix meteor's ArithmeticException (#33556)

Co-authored-by: Winkarst <74284083+Winkarst-cpu@users.noreply.github.co>
This commit is contained in:
Winkarst
2024-12-05 15:20:27 +03:00
committed by GitHub
parent 6f51aa4b15
commit ce672acf91

View 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;