public static IntVec3 FindSiegePositionFrom(IntVec3 entrySpot, Map map) { if (!entrySpot.IsValid) { IntVec3 intVec; if (!CellFinder.TryFindRandomEdgeCellWith((IntVec3 x) => x.Standable(map) && !x.Fogged(map), map, CellFinder.EdgeRoadChance_Ignore, out intVec)) { intVec = CellFinder.RandomCell(map); } Log.Error("Tried to find a siege position from an invalid cell. Using " + intVec, false); return(intVec); } IntVec3 result; for (int i = 70; i >= 20; i -= 10) { if (RCellFinder.TryFindSiegePosition(entrySpot, (float)i, map, out result)) { return(result); } } if (RCellFinder.TryFindSiegePosition(entrySpot, 100f, map, out result)) { return(result); } Log.Error(string.Concat(new object[] { "Could not find siege spot from ", entrySpot, ", using ", entrySpot }), false); return(entrySpot); }
internal static IntVec3 FindSiegePositionFrom(IntVec3 entrySpot, Map map) { for (int num = 70; num >= 20; num -= 10) { IntVec3 result = default(IntVec3); if (RCellFinder.TryFindSiegePosition(entrySpot, (float)num, map, out result)) { return(result); } } Log.Error("Could not find siege spot from " + entrySpot + ", using " + entrySpot); return(entrySpot); }
internal static IntVec3 FindSiegePositionFrom(IntVec3 entrySpot, Map map) { for (int i = 70; i >= 20; i -= 10) { IntVec3 result; if (RCellFinder.TryFindSiegePosition(entrySpot, (float)i, map, out result)) { return(result); } } Log.Error(string.Concat(new object[] { "Could not find siege spot from ", entrySpot, ", using ", entrySpot })); return(entrySpot); }