Use map coordinates for spraying (#9505)

This commit is contained in:
TekuNut
2022-07-12 03:37:02 +01:00
committed by GitHub
parent fd4ca91d6f
commit 97f995b986
3 changed files with 43 additions and 24 deletions

View File

@@ -43,7 +43,7 @@ namespace Content.Server.Chemistry.EntitySystems
}
}
public void Start(VaporComponent vapor, Vector2 dir, float speed, EntityCoordinates target, float aliveTime)
public void Start(VaporComponent vapor, Vector2 dir, float speed, MapCoordinates target, float aliveTime)
{
vapor.Active = true;
vapor.Target = target;
@@ -112,8 +112,7 @@ namespace Content.Server.Chemistry.EntitySystems
// Check if we've reached our target.
if (!vapor.Reached &&
vapor.Target.TryDistance(EntityManager, xform.Coordinates, out var distance) &&
distance <= 0.5f)
(vapor.Target.Position - xform.MapPosition.Position).LengthSquared <= 0.25f)
{
vapor.Reached = true;
}