This affects options like NO_VITAMINS, FILTHY_MORALE etc.
In general, it seems that world options are loaded multiple times in some weird order. I added a new flag and wanted to test how is it loaded and found that in a world with FILTHY_MORALE flag, it is set 9 times in one game load. The new flag was only set 2 times, despite being in the same "context" as FILTHY_MORALE.
Now that I think about it, it is probably the same bug that caused the radiation mutation to reset to the default value of true.
I think I get it now:
The option system doesn't verify if we're asking for world options or global options. So when someone asks for a global option, it gives the default world settings not the current world settings.
Should asking for a world option using the non-world get_option
produce a warning, give the world value instead or keep the dangerous behavior?
I think going with world value is safest here.
How about warning in debug builds and world option in release builds?
Regardless, it sounds like the interface needs changing, it shouldn't be
possible to "accidentally" ask for the wrong set of options.
warning in debug builds
That wouldn't help much. Debug builds are unbearably slow and many of the options would require getting a bit deeper into to test.
I'd much rather do it manually, by greping get_option
, correcting all values, then having it hardcoded to always warn.
Most helpful comment
That wouldn't help much. Debug builds are unbearably slow and many of the options would require getting a bit deeper into to test.
I'd much rather do it manually, by greping
get_option
, correcting all values, then having it hardcoded to always warn.