Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48b5c9a

Browse files
committed
fix: initialize forbid config in existing saves
1 parent 88717fe commit 48b5c9a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugins/logistics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ static void validate_stockpile_configs(color_ostream& out,
134134
to_remove.push_back(stockpile_number);
135135
continue;
136136
}
137-
if (c.get_int(STOCKPILE_CONFIG_FORBID) == -1)
138-
c.set_int(STOCKPILE_CONFIG_FORBID, 0);
139137
cache.emplace(bld, c);
140138
}
141139
for (int stockpile_number : to_remove)
@@ -179,6 +177,8 @@ DFhackCExport command_result plugin_load_site_data(color_ostream &out) {
179177
auto& c = loaded_persist_data[idx];
180178
if (c.key() == CONFIG_KEY)
181179
continue;
180+
if (c.get_int(STOCKPILE_CONFIG_FORBID) == -1) // remove this once saves from 50.08 are no longer compatible
181+
c.set_int(STOCKPILE_CONFIG_FORBID, 0);
182182
watched_stockpiles.emplace(c.get_int(STOCKPILE_CONFIG_STOCKPILE_NUMBER), c);
183183
}
184184
migrate_old_keys(out);

0 commit comments

Comments
 (0)