Example #1
0
        internal static bool CanMove(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation, Map map)
        {
            Region oldRegion = m.Region;
            Region newRegion = Find(newLocation, map);

            while (oldRegion != newRegion)
            {
                if (!newRegion.OnMoveInto(m, d, newLocation, oldLocation))
                {
                    return(false);
                }

                if (newRegion.m_Parent == null)
                {
                    return(true);
                }

                newRegion = newRegion.m_Parent;
            }

            return(true);
        }