fix(menu): the chosen memory budget survives a restart #2376
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2376
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/options-budget-once"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The memory budget you pick in the options does not stick: at the next start the game goes back to the one the options file had before, and the file gains one more
memory_budget=line each time the options are saved.What changed
save()ingpu/vk/vk_menu.cppwrites the lines it owns, then copies every other line the options file had. It writesmemory_budget=itself (the budget is not a menu row), butmemory_budgetwas not among the keys it counted as its own, so the file's old line was copied after the new one. The reader at start-up keeps the last line, so the old budget won.memory_budgetis now one of save()'s own keys, besidemicrophone_deviceandoptions_version.Tests
tests/test_options_budget_once.py: every keysave()writes withfprintfmust be one it owns. It fails on currentmainand passes with the change.python -I -B tests/run_all.py menu: 14 passed (Linux).Looks right. I read save() and the start-up reader at this sha.
memory_budget=itself but copied the file's old line afterwards as an "other" line, and the reader keeps the last one, so the old budget won. Adding it to the owned keys fixes exactly that.memory_budget=line is now dropped and one is written. Until then the reader still takes the last line, same as before.minetest, so pad_/key_, discord_app_id= and any other unknown lines are still kept as before.bool mine = ...;andfprintf(f, "key=shapes), but it fails loudly if they change, which is fine.Only CI check listed is the title check, still pending when I looked.
github-sync referenced this pull request2026-11-12 06:22:54 +00:00