Support enemy_expansion.build_base_unit_dispatch_cooldown in exchange strings (#977)

* 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>

* Replace version flags with versionAtLeast in exchange string reader

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cooldude2606andClaude Fable 5 authored and GitHub committed 2026-08-19 23:24:58 +01:00
commit 59cd193b65
5 files changed
+63 -16

No files matched your search

+7 -3
View File
@@ -1211,10 +1211,14 @@ describe("Integration of Clusterio", function() {
await execCtl("instance start 44");
const instance = (await getInstances()).get(44);
const isV2 = lib.integerPartialVersion(instance.factorioVersion) > lib.integerPartialVersion("2.0");
const isV2_1 = lib.integerPartialVersion(instance.factorioVersion) > lib.integerPartialVersion("2.1");
const version = lib.integerPartialVersion(instance.factorioVersion);
const isV2 = version > lib.integerPartialVersion("2.0");
const isV2_1 = version > lib.integerPartialVersion("2.1");
const isV2_1_13 = version >= lib.integerPartialVersion("2.1.13");
let exchangeString = testStrings.modified;
if (isV2_1) {
if (isV2_1_13) {
exchangeString = testStrings.modified_v2_1_13;
} else if (isV2_1) {
exchangeString = testStrings.modified_v2_1;
} else if (isV2) {
exchangeString = testStrings.modified_v2;