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
SUMMARY: Bugfixes "Made "minefield" map extra actually spawn."
Purpose of change
Closes #38289 - Minefields don't spawn.
Describe the solution
Previously
minefield
map extra's conditions were so strict that effectively it won't spawn at all. Everyroad
overmap terrain had to roll one-in-75 = 1.33% check to decide whether this particular location should spawn map extra at all. If this 1-percent roll succeeded, an attempt to selectmx_minefield
map extra from a set is made.mx_minefield
has a weight of 80, and there is plenty of other map extras with this weight or even larger in this set. If we're lucky to successfully roll these two checks on a particular road overmap terrain, we then need to check if this OT has a bridge nearby. The resulting chance to successfully all satisfy these three checks was very tiny. So I reworked the conditions to make this map extra actually spawn.Created a separate
bridge
set of map extras and filled it withmx_minefield
map extra with 20% chance to spawn on every bridge entry. Updated most coordinates in map extra's mapgen to reflect change fromroad
tobridge
spawning location.Describe alternatives you've considered
None.
Testing
Teleported around map to find bridges, checked these bridges' entries for spawning of minefields.
Additional context
The chance to spawn (currently 20% per every bridge entry) could be lowered or increased if needed.
Thanks @ralreegorganon for looking into matter of this issue and explaining me how to fix it.