Bind gen2Constants in the save editor's Gold bootstrap

bindGoldData points gen2Palettes, gen2Icons, gen2Pokedex, gen2Landmarks,
gen2Roofs and gen2Sprites at the extractor's own Gold tables through
loadGen, but never gen2Constants -- despite Schemas.GEN2 routing
`constants` to that same namespaced-and-differently-shaped category
palettes and icons are in. A save editor boot left data.gen2Constants
unset, so mod.content.constants:get(...) read an empty table instead
of the cart's ordered name lists, misreading the generation and
rejecting every record a mod shaped off it.

data.gen2Constants now goes through the same loadGen("constants") path
the other five already use, falling back the same way they do when no
ROM cache is active.
This commit is contained in:
sanjinpepic
2026-08-16 20:21:47 +02:00
parent 455ff21aff
commit c23f85cba9
2 changed files with 23 additions and 0 deletions
+6
View File
@@ -95,6 +95,12 @@ function Gen.bindGoldData(data)
end
data.gen2Palettes = data.gen2Palettes or loadGen("palettes")
-- Namespaced AND differently shaped in Schemas.GEN2 (the cart's ordered
-- name lists, not Gen 1's rule table), same as palettes/icons below --
-- omitting it left mod.content.constants:get(...) reading an empty table
-- under a Gold save-editor boot, which is what misreads "generation" and
-- rejects every record a mod shapes off it.
data.gen2Constants = data.gen2Constants or loadGen("constants")
data.gen2Icons = data.gen2Icons or loadGen("icons")
data.gen2Pokedex = data.gen2Pokedex or loadGen("pokedex")
data.gen2Landmarks = data.gen2Landmarks or loadGen("landmarks")