Support enemy_expansion.build_base_unit_dispatch_cooldown in exchange strings

Factorio 2.1.13 added build_base_unit_dispatch_cooldown as the last
field of enemy_expansion in the map exchange string, and rejects map
settings without it. Track the full version in the reader state and
read the field for 2.1.13 and later. Adds a fixture string generated
with 2.1.14 and uses it in the load-scenario integration test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Fable 5 committed 2026-08-18 22:21:28 +00:00
1 parent 0be4fd77e5
commit 021ee1725b
5 files changed
+59 -6

No files matched your search

+10
View File
@@ -69,6 +69,16 @@ describe("lib/factorio/exchange_string", function() {
});
});
it("should parse post v2.1.13 strings", function() {
assert.deepEqual(lib.readMapExchangeString(testStrings.modified_v2_1_13), {
version: [2, 1, 14, 1],
unknown: 0,
map_gen_settings: testSettings.modified_v2_1_map_gen_settings,
map_settings: testSettings.modified_v2_1_13_map_settings,
checksum: 272054359,
});
});
it("should handle malformed strings", function() {
assert.throws(
() => lib.readMapExchangeString("<<blah>>"),