Fixes click-facing giving you NaN rotation if you interact with something at the exact same position as you.
This commit is contained in:
@@ -479,7 +479,13 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
var item = hands.GetActiveHand?.Owner;
|
||||
|
||||
if (ActionBlockerSystem.CanChangeDirection(player))
|
||||
playerTransform.LocalRotation = new Angle(coordinates.ToMapPos(_mapManager) - playerTransform.MapPosition.Position);
|
||||
{
|
||||
var diff = coordinates.ToMapPos(_mapManager) - playerTransform.MapPosition.Position;
|
||||
if (diff.LengthSquared > 0.01f)
|
||||
{
|
||||
playerTransform.LocalRotation = new Angle(diff);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ActionBlockerSystem.CanInteract(player))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user