Reset mapmetadata_* modoptions on map change - #637
Conversation
There was a problem hiding this comment.
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
a127f58 to
f02f1ea
Compare
Without this, modoptions that don't have value set for map will stay set when changing the map.
Assisted-by: Claude:opus-5