mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
fixed player position updates i think
This commit is contained in:
@@ -540,7 +540,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public bool IsFacing(float x, float y, byte checkAngle = 45)
|
||||
public bool IsFacing(float x, float y)
|
||||
{
|
||||
var rot1 = this.rotation;
|
||||
|
||||
@@ -554,6 +554,26 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
return rot1 == (float)dRot;
|
||||
}
|
||||
|
||||
public bool IsFacing(Actor target)
|
||||
{
|
||||
if (target == null)
|
||||
{
|
||||
Program.Log.Error("[{0}][{1}] IsFacing no target!", actorId, actorName);
|
||||
return false;
|
||||
}
|
||||
|
||||
var rot1 = this.rotation;
|
||||
|
||||
var dX = this.positionX - target.positionX;
|
||||
var dY = this.positionY - target.positionY;
|
||||
|
||||
var rot2 = Math.Atan2(dY, dX);
|
||||
|
||||
var dRot = Math.PI - rot2 + Math.PI / 2;
|
||||
|
||||
return rot1 == (float)dRot;
|
||||
}
|
||||
|
||||
public void LookAt(Actor actor)
|
||||
{
|
||||
if (actor != null)
|
||||
|
Reference in New Issue
Block a user