-
Notifications
You must be signed in to change notification settings - Fork 494
Allow disabling quick start resource override #6270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Allow disabling quick start resource override #6270
Conversation
| ) | ||
| if not shouldRunGadget then return false end | ||
|
|
||
| local overrideQuickStartResources = tonumber(modOptions.override_quick_start_resources) or 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modoptions do not need type coercion of default value assignment, the game overrides Spring.GetModOptions() to do both these things.
|
Edit: looks like that's #6269, sounds good then. |
|
As an aside,
if people run these tests and think it makes the PR good then the tests are worse than worthless. They don't test anything useful so just provide a false sense of security. |
|
@WatchTheFort I dropped the redundant tonumber(... ) or 0 and now rely on Spring.GetModOptions()’s default/coercion for override_quick_start_resources. @sprunk I added a small LuaUI test (LuaUI/Tests/quick_start_resources.lua) to make sure quickStartBudgetBase uses the override when >0 and the default budget when 0/“default”. Ran it headless with the existing docker harness, both with override=0 and override=5000, and it passes. As you noted, the quick_start_range topic is tracked separately in #6269. |
modoptions.lua
Outdated
| step = 1, | ||
| section = "options_extra", | ||
| hidden = true, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some formatting problems here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops -- okay I fixed the indents on that one.
Summary
Testing