Skip to content

Commit

Permalink
Fix meteor's ArithmeticException (space-wizards#33556)
Browse files Browse the repository at this point in the history
Co-authored-by: Winkarst <[email protected]>
  • Loading branch information
Winkarst-cpu and Winkarst authored Dec 5, 2024
1 parent 6f51aa4 commit ce672ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Content.Server/Projectiles/ProjectileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ private void OnStartCollide(EntityUid uid, ProjectileComponent component, ref St
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);

Expand All @@ -64,7 +63,9 @@ private void OnStartCollide(EntityUid uid, ProjectileComponent component, ref St
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;
Expand Down

0 comments on commit ce672ac

Please sign in to comment.