Fixes click-facing giving you NaN rotation if you interact with something at the exact same position as you.
This commit is contained in:
@@ -478,8 +478,14 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
var item = hands.GetActiveHand?.Owner;
|
var item = hands.GetActiveHand?.Owner;
|
||||||
|
|
||||||
if(ActionBlockerSystem.CanChangeDirection(player))
|
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))
|
if (!ActionBlockerSystem.CanInteract(player))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user