Fixing more merge errors. I'm bad at this

This commit is contained in:
yogurt 2017-07-11 09:50:54 -05:00
parent 86a2e4aff3
commit 4dee26e136
2 changed files with 35 additions and 22 deletions

View file

@ -149,11 +149,39 @@ namespace FFXIVClassic_Map_Server.Actors
//spawnPacket.DebugPrintSubPacket();
return spawnPacket;
}
}
public SubPacket CreatePositionUpdatePacket(uint playerActorId)
public SubPacket CreatePositionUpdatePacket(bool forceUpdate = false)
{
return MoveActorToPositionPacket.BuildPacket(actorId, playerActorId, positionX, positionY, positionZ, rotation, moveState);
int updateMs = 300;
var diffTime = (DateTime.Now - lastMoveUpdate);
if (this.target != null)
{
updateMs = 150;
}
if (forceUpdate || (hasMoved && ((this is Player) || diffTime.Milliseconds >= updateMs)))
{
hasMoved = (this.positionUpdates != null && this.positionUpdates.Count > 0);
if (hasMoved)
{
var pos = positionUpdates[0];
if (this is Character)
((Character)this).OnPath(pos);
positionX = pos.X;
positionY = pos.Y;
positionZ = pos.Z;
//Program.Server.GetInstance().mLuaEngine.OnPath(actor, position, positionUpdates)
positionUpdates.RemoveAt(0);
}
lastMoveUpdate = DateTime.Now;
return MoveActorToPositionPacket.BuildPacket(actorId, positionX, positionY, positionZ, rotation, moveState);
}
return null;
}
public SubPacket CreateStatePacket()