Skip to content

Commit

Permalink
fix: client side projectile issue (#2320)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arufonsu authored Jul 9, 2024
1 parent 3cef1f1 commit 6761c4c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Intersect.Client/Entities/Projectiles/Projectile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,8 @@ public void CheckForCollision()
{
if (_targetId != Guid.Empty && _targetId != _owner || _lastTargetX != -1 && _lastTargetY != -1 && _lastTargetMapId != Guid.Empty)
{
var (deltaX, deltaY) = (GetProjectileOffset(projectileSpawn, true), GetProjectileOffset(projectileSpawn, false));
float distance = MathF.Sqrt(deltaX * deltaX + deltaY * deltaY);
float xFactor = deltaX / distance;
float yFactor = deltaY / distance;
newx += xFactor;
newy += yFactor;
newx += GetProjectileOffset(projectileSpawn, true);
newy += GetProjectileOffset(projectileSpawn, false);
}
}
else
Expand Down

0 comments on commit 6761c4c

Please sign in to comment.