Ejemplo n.º 1
0
        public static IntVec3 GetDeliveryCell(TraverseParms traverseParms, Map map)
        {
            if (!PaymentUtil.checkForTaxSpot(map, out IntVec3 intVec3))
            {
                intVec3 = ValidLandingCell(new IntVec2(1, 1), map, true);
            }

            IntVec3 oldVec = intVec3;

            for (int i = 0; i < 10; i++)
            {
                if (CellFinder.TryFindRandomReachableCellNear(intVec3, map, i, traverseParms, cell => map.thingGrid.ThingsAt(cell) == null, null, out intVec3))
                {
                    break;
                }

                if (i == 9)
                {
                    intVec3 = oldVec;
                }
            }

            return(intVec3);
        }