static bool Prefix(ref FogGrid __instance, ref Map ___map, IntVec3 c) { if (!(___map.Parent is City)) { return(true); } __instance.Unfog(c); FloodUnfogResult floodUnfogResult = default(FloodUnfogResult); for (int i = 0; i < 4; i++) { IntVec3 intVec = c + GenAdj.CardinalDirections[i]; if (intVec.InBounds(___map) && intVec.Fogged(___map)) { Building edifice = intVec.GetEdifice(___map); if (edifice == null || !edifice.def.MakeFog) { floodUnfogResult = FloodFillerFog.FloodUnfog(intVec, ___map); } else { __instance.Unfog(intVec); } } } for (int j = 0; j < 8; j++) { IntVec3 c2 = c + GenAdj.AdjacentCells[j]; if (c2.InBounds(___map)) { Building edifice2 = c2.GetEdifice(___map); if (edifice2 != null && edifice2.def.MakeFog) { __instance.Unfog(c2); } } } return(false); }
static bool Prefix(ref FogGrid __instance, ref Map ___map, IntVec3 c) { if (___map.Parent is City) { var map = ___map; __instance.Unfog(c); for (var index = 0; index < 4; ++index) { var intVec3 = c + GenAdj.CardinalDirections[index]; if (intVec3.InBounds(map) && intVec3.Fogged(map)) { var edifice = intVec3.GetEdifice(map); if (edifice == null || !edifice.def.MakeFog) { FloodFillerFog.FloodUnfog(intVec3, map); } else { __instance.Unfog(intVec3); } } } for (var index = 0; index < 8; ++index) { var c1 = c + GenAdj.AdjacentCells[index]; if (c1.InBounds(map)) { var edifice = c1.GetEdifice(map); if (edifice != null && edifice.def.MakeFog) { __instance.Unfog(c1); } } } return(false); } return(true); }