mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-11 15:04:42 +02:00
fixed player position updates i think
This commit is contained in:
parent
dd552ba69d
commit
b640c87c69
3 changed files with 64 additions and 36 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue