Core.TickCount for some AI actions

Correction in NewAsyncSockets
This commit is contained in:
Mark Sturgill 2013-10-06 17:21:40 -07:00
parent 92aeef0297
commit be920e0c31
5 changed files with 19 additions and 17 deletions

View file

@ -1999,9 +1999,9 @@ namespace Server.Mobiles
return delay;
}
private DateTime m_NextMove;
private int m_NextMove;
public DateTime NextMove
public int NextMove
{
get { return m_NextMove; }
set { m_NextMove = value; }
@ -2009,7 +2009,7 @@ namespace Server.Mobiles
public virtual bool CheckMove()
{
return (DateTime.UtcNow >= m_NextMove);
return (Core.TickCount - m_NextMove >= 0);
}
public virtual bool DoMove(Direction d)
@ -2036,12 +2036,12 @@ namespace Server.Mobiles
// This makes them always move one step, never any direction changes
m_Mobile.Direction = d;
TimeSpan delay = TimeSpan.FromSeconds(TransformMoveDelay(m_Mobile.CurrentSpeed));
int delay = (int)(TransformMoveDelay(m_Mobile.CurrentSpeed) * 1000);
m_NextMove += delay;
if (m_NextMove < DateTime.UtcNow)
m_NextMove = DateTime.UtcNow;
if (Core.TickCount - m_NextMove > 0)
m_NextMove = Core.TickCount;
m_Mobile.Pushing = false;
@ -2470,13 +2470,13 @@ namespace Server.Mobiles
return false;
}
if (m_Mobile.NextReacquireTime > DateTime.UtcNow)
if (Core.TickCount - m_Mobile.NextReacquireTime < 0)
{
m_Mobile.FocusMob = null;
return false;
}
m_Mobile.NextReacquireTime = DateTime.UtcNow + m_Mobile.ReacquireDelay;
m_Mobile.NextReacquireTime = Core.TickCount + (int)m_Mobile.ReacquireDelay.TotalMilliseconds;
m_Mobile.DebugSay("Acquiring...");