Server.Mobiles.BaseAI.MoveTo C# (CSharp) Méthode

MoveTo() public méthode

public MoveTo ( Server.Mobile m, bool run, int range ) : bool
m Server.Mobile
run bool
range int
Résultat bool
		public virtual bool MoveTo(Mobile m, bool run, int range)
		{
			if (m_Mobile.Deleted || m_Mobile.DisallowAllMoves || m == null || m.Deleted)
				return false;

			if (m_Mobile.InRange(m, range))
			{
				m_Path = null;
				return true;
			}

			if (m_Path != null && m_Path.Goal == m)
			{
				if (m_Path.Follow(run, 1))
				{
					m_Path = null;
					return true;
				}
			}
			else if (!DoMove(m_Mobile.GetDirectionTo(m), true))
			{
				m_Path = new PathFollower(m_Mobile, m);
				m_Path.Mover = new MoveMethod(DoMoveImpl);

				if (m_Path.Follow(run, 1))
				{
					m_Path = null;
					return true;
				}
			}
			else
			{
				m_Path = null;
				return true;
			}

			return false;
		}