Ejemplo n.º 1
0
        public static bool CheckMulti(Point3D p, Map map, bool houses)
        {
            if (map == null || map == Map.Internal)
            {
                return(false);
            }

            Sector sector = map.GetSector(p.X, p.Y);

            for (int i = 0; i < sector.Multis.Count; ++i)
            {
                BaseMulti multi = sector.Multis[i];

                BaseBoat boat = BaseBoat.FindBoatAt(p, map);

                if (boat != null)
                {
                    return(true);
                }

                if (multi is BaseHouse && !(((BaseHouse)multi) is GreenTent || ((BaseHouse)multi) is BlueTent))
                {
                    if (houses && ((BaseHouse)multi).IsInside(p, 16))
                    {
                        return(true);
                    }
                }
                else if (multi.Contains(p) && (multi is BaseHouse && !(((BaseHouse)multi) is GreenTent || ((BaseHouse)multi) is BlueTent)))
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        public static bool CheckMulti(Point3D p, Map map, bool houses = true, int housingrange = 0)
        {
            if (map == null || map == Map.Internal)
            {
                return(false);
            }

            Sector sector = map.GetSector(p.X, p.Y);

            for (int i = 0; i < sector.Multis.Count; ++i)
            {
                BaseMulti multi = sector.Multis[i];

                if (multi is BaseHouse bh)
                {
                    if ((houses && bh.IsInside(p, 16)) || (housingrange > 0 && bh.InRange(p, housingrange)))
                    {
                        return(true);
                    }
                }
                else if (multi.Contains(p))
                {
                    return(true);
                }
            }

            return(false);
        }
        public static bool CheckMulti(Point3D p, Map map, bool houses)
        {
            if (map == null || map == Map.Internal)
            {
                return(false);
            }

            Sector sector = map.GetSector(p.X, p.Y);

            for (int i = 0; i < sector.Multis.Count; ++i)
            {
                BaseMulti multi = sector.Multis[i];

                if (multi is BaseHouse)
                {
                    if (houses && ((BaseHouse)multi).IsInside(p, 16))
                    {
                        return(true);
                    }
                }
                else if (multi.Contains(p))
                {
                    return(true);
                }
            }

            return(false);
        }