public void TryRebuildDirtyRegionsAndRooms() { if (working || !Enabled) { return; } working = true; if (!initialized) { RebuildAllRegionsAndRooms(); } if (!map.regionDirtyer.AnyDirty) { working = false; return; } try { RegenerateNewRegionsFromDirtyCells(); CreateOrUpdateRooms(); } catch (Exception arg) { Log.Error("Exception while rebuilding dirty regions: " + arg); } newRegions.Clear(); map.regionDirtyer.SetAllClean(); initialized = true; working = false; if (DebugSettings.detectRegionListersBugs) { Autotests_RegionListers.CheckBugs(map); } }
public void TryRebuildDirtyRegionsAndRooms() { if (!this.working && this.Enabled) { this.working = true; if (!this.initialized) { this.RebuildAllRegionsAndRooms(); } if (!this.map.regionDirtyer.AnyDirty) { this.working = false; } else { try { this.RegenerateNewRegionsFromDirtyCells(); this.CreateOrUpdateRooms(); } catch (Exception arg) { Log.Error("Exception while rebuilding dirty regions: " + arg, false); } this.newRegions.Clear(); this.map.regionDirtyer.SetAllClean(); this.initialized = true; this.working = false; if (DebugSettings.detectRegionListersBugs) { Autotests_RegionListers.CheckBugs(this.map); } } } }
private static void CheckRegionListers() { Autotests_RegionListers.CheckBugs(Find.CurrentMap); }