public static void checkNPCInRange(int heroX, int heroY)
        {
            ArrayList list = new ArrayList();
            int       num6 = mainFunctions.getNPCCount() - 1;

            for (int i = 0; i <= num6; i++)
            {
                NPCShip ship = mainFunctions.getNPC(i);
                double  num3 = ship.getPosX();
                double  num4 = ship.getPosY();
                double  num  = heroX - num3;
                if ((num > -1500.0) & (num < 1500.0))
                {
                    double num5 = heroY - num4;
                    if ((num5 > -1500.0) & (num5 < 1500.0))
                    {
                        list.Add(ship);
                    }
                }
            }
            if (list.Count != 0)
            {
                IEnumerator enumerator;
                try
                {
                    enumerator = list.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        NPCShip current = (NPCShip)enumerator.Current;
                        if (!checkForDoubleNPC(current.getUserID()))
                        {
                            initConnection.createNPC(current.getUserID(), current.getPosX(), current.getPosY(), current.getShipType(), current.getUsername());
                            Module1.displayNPCs.Add(current.getUserID());
                        }
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
            }
        }