Skip to content

Reset mapmetadata_* modoptions on map change - #637

Merged
p2004a merged 1 commit into
beyond-all-reason:mainfrom
p2004a:fix-modoption-reset
Aug 3, 2026
Merged

Reset mapmetadata_* modoptions on map change#637
p2004a merged 1 commit into
beyond-all-reason:mainfrom
p2004a:fix-modoption-reset

Conversation

@p2004a

@p2004a p2004a commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Without this, modoptions that don't have value set for map will stay set when changing the map.

Assisted-by: Claude:opus-5

@burnhamrobertp burnhamrobertp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a look since this touches the startbox override. The reset works - I ran it against the real SpadsConf loader and !bSet mapmetadata_startbox_override foo followed by a map change now clears it, where before it stuck.

Couple of things I ran into.

The [map_X<map_DEFAULT>] rename means a plain [map_X] section anywhere in the battle presets now fails the whole config load instead of merging. I tried adding [map_Ascendancy_v2_2] (transparent) to battlePresets.conf: before this change it loads fine with a duplicate-param warning, after it the loader logs "multiple inconsistent preset inheritances" and returns nothing, checkBConfig bails, and SPADS won't start. The two end up in one set of presets, since battlePresets.conf pulls in the generated mapBattlePresets.conf at line 161 - and one side is hand-edited while the other gets copied over by CI on its own, so nothing parses the combination before it reaches a host. Maybe worth a line in the generated header saying map_* is taken now, or naming the base preset something a sanitized map name can't produce.

Since map presets get applied after the global one, the override spec in here also wins over the copy in battlePresets.conf from the first map change onward. I widened the [team] one to allow dots and it only held until I changed maps, then it dropped back to the narrower generated version. They're identical today so no impact, but if they ever drift, the message an operator sees points at the mod/preset rather than at a generated file in another repo.

Smaller one: the generated keys in map_DEFAULT are still emitted bare. If the startboxes_set mitigation comes off and a map sets startpos but not startboxes_set, wouldn't that map end up with the empty string as the only allowed value for it? Same trap your comment describes, just for the generated keys rather than the hardcoded one.

Nothing here looks blocking from where I sit - you'd know better whether any of it is worth holding the merge for.

AI disclosure: written with assistance from Claude Code.

Without this, modoptions that don't have value set for map will
stay set when changing the map.

Assisted-by: Claude:opus-5
@p2004a
p2004a force-pushed the fix-modoption-reset branch from a127f58 to f02f1ea Compare August 2, 2026 17:43
@p2004a
p2004a merged commit 688938f into beyond-all-reason:main Aug 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants