示例#1
0
 internal static void CleanDeadMaps()
 {
     for (int i = 0; i < RestrictManager.activePolicies.Count; i++)
     {
         MapActivePolicy map = RestrictManager.activePolicies[i];
         if (!Find.Maps.Any(x => x.uniqueID == map.mapId))
         {
             if (Find.Maps.Count == 1 && !RestrictManager.ActivePoliciesContainsValidMap())
             {
                 //this means the player was on the move without any base
                 //and just re-settled. So, let's move the settings to
                 //the new map
                 int mapid = Find.CurrentMap.uniqueID;
                 RestrictManager.MoveLinksToMap(mapid);
                 map.mapId = mapid;
             }
             else
             {
                 RestrictManager.DeleteLinksInMap(map.mapId);
                 RestrictManager.DeleteMap(map);
             }
         }
     }
 }