Skip to content
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

[DDA Port] Check mapgen dimensions, stop duplicating mapgen functions #2197

Merged
merged 4 commits into from
Dec 17, 2022

Conversation

olanti-p
Copy link
Member

Summary

SUMMARY: Bugfixes "Check mapgen dimensions, stop duplicating mapgen functions"

Purpose of change

  1. Check when mapgen erroneously exceeds 24x24 boundaries
  2. Fix bug where mapgen functions get duplicated (increases game RAM usage)

Describe the solution

Port DDA PRs:
CleverRaven/Cataclysm-DDA#51431
CleverRaven/Cataclysm-DDA#59111

Testing

Loaded a world, saw no debug messages

jbytheway and others added 4 commits November 20, 2022 18:48
Previously there was no error if the dimensions of the "rows" array in
mapgen was too large (there was an error when it was too small).

Add such an error, and fix all the mapgen issues it finds.

(cherry picked from commit adf846bfdf1182380fbd22cf33479f196222f8f7)
load_mapgen_function would add the mapgens it loaded to oter_mapgen.
However, some of the call sites would also add the returned value to
oter_mapgen anyway.  This meant that some mapgens got added twice.  This
could effectively double their weights, and caused them to be
sanity-checked multiple times.

Separate the adding functionality into a new function
load_and_add_mapgen_function so that it is clear when it's being added
for you, but the one call site that needed special handling could
perform its own adding separately.

(cherry picked from commit e9046e9bae07dcac8375eb81b9cea14d7595c3de)
@github-actions github-actions bot added data PRs related to datas. Won't crash game (probably) mods PR changes related to mods. src PR changes related to source code. labels Nov 20, 2022
@Coolthulhu Coolthulhu self-assigned this Dec 11, 2022
@Coolthulhu Coolthulhu merged commit 3af8d5c into cataclysmbnteam:upload Dec 17, 2022
@olanti-p olanti-p deleted the port-mapgen-fixes branch December 17, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data PRs related to datas. Won't crash game (probably) mods PR changes related to mods. src PR changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants