Fix classic zombies map extras chance values which could cause debugmsg #49396
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Mods "Fix classic zombies map extras chance values"
Purpose of change
Classic zombies was setting the weight of various map_extras to zero. This makes sense, but it was also setting the chance of map extras on certain extras types for every region. This is problematic because some regions' extras types lacked any map extras, so setting the chance non-zero led to errors when the game tried to select an extra.
Describe the solution
First, add more validation to the map extras weights so that this issue is caught at validation time rather than at random at map generation time.
Change the classic zombies mod to just set the extras weights and not set the chance, so that the regions with no extras would remain at the default chance of zero and no errors would arise.
As a side-effect, this dramatically increases the chance of field map extras for the classic zombies mod which had become out of sync with the base game, which is probably an improvement.
Describe alternatives you've considered
Maybe this should have targeted master, but I've only been working on
0.F-dev
lately, so I'm not sure whether the same issue exists in master.Testing
The new checks I added now pass in unit testing with mods loaded.
Additional context
Noticed because of CI errors on my PR #48529.