| 127 | } |
| 128 | |
| 129 | static void validate_stockpile_configs(color_ostream& out, |
| 130 | unordered_map<df::building_stockpilest *, PersistentDataItem> &cache) { |
| 131 | vector<int> to_remove; |
| 132 | for (auto& entry : watched_stockpiles) { |
| 133 | int stockpile_number = entry.first; |
| 134 | PersistentDataItem &c = entry.second; |
| 135 | auto bld = find_stockpile(stockpile_number); |
| 136 | if (!bld || ( |
| 137 | !c.get_bool(STOCKPILE_CONFIG_MELT) && |
| 138 | !c.get_bool(STOCKPILE_CONFIG_TRADE) && |
| 139 | !c.get_bool(STOCKPILE_CONFIG_DUMP) && |
| 140 | !c.get_bool(STOCKPILE_CONFIG_TRAIN) && |
| 141 | !(c.get_int(STOCKPILE_CONFIG_FORBID) > STOCKPILE_CONFIG_FORBID_OFF))) { |
| 142 | to_remove.push_back(stockpile_number); |
| 143 | continue; |
| 144 | } |
| 145 | cache.emplace(bld, c); |
| 146 | } |
| 147 | for (int stockpile_number : to_remove) |
| 148 | remove_stockpile_config(out, stockpile_number); |
| 149 | } |
| 150 | |
| 151 | // remove this function once saves from 50.08 are no longer compatible |
| 152 | static void migrate_old_keys(color_ostream &out) { |
no test coverage detected