public virtual bool DoOrderCome()
{
if (m_Mobile.ControlMaster != null && !m_Mobile.ControlMaster.Deleted)
{
int iCurrDist = (int)m_Mobile.GetDistanceToSqrt(m_Mobile.ControlMaster);
if (iCurrDist > m_Mobile.RangePerception)
{
m_Mobile.DebugSay("I have lost my master. I stay here");
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.None;
}
else
{
m_Mobile.DebugSay("My master told me come");
// Not exactly OSI style, but better than nothing.
bool bRun = (iCurrDist > 5);
if (WalkMobileRange(m_Mobile.ControlMaster, 1, bRun, 0, 1))
{
if (m_Mobile.Combatant != null && !m_Mobile.Combatant.Deleted && m_Mobile.Combatant.Alive && !m_Mobile.Combatant.IsDeadBondedPet)
{
m_Mobile.Warmode = true;
m_Mobile.Direction = m_Mobile.GetDirectionTo(m_Mobile.Combatant);
}
else
{
m_Mobile.Warmode = false;
}
}
}
}
return true;
}