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

Fix town buildings #22723

Merged
merged 1 commit into from Jan 16, 2018

Conversation

Projects
None yet
2 participants
@codemime
Copy link
Member

commented Jan 9, 2018

Closes #22358.
Closes #21497.

Overview

@kevingranade was right in his suspicions regarding the first issue. The @Coolthulhu's idea of unifying town buildings with overmap specials is really great, the implementation, however, has a minor bug which caused #22358. find_max_size() performs checks after it increments its counters, so the result value isn't always correct. #21497 is fixed by allowing buildings to override marshlands. Also, buildings can't spawn by themselves like other overmap specials do. This was definitely possible, but I didn't find a corresponding issue.

Implementation details

  • Town buildings are now yet more like the real overmap specials. They both use the same check (can_place_special()) which obsoletes building_size along with the functions that operate on it. So they all were removed (find_max_size() was among them).
  • Added locations and a check for max occurrences to the fake overmap specials (zero max_occurrences prevents their spawn "in the wild").
  • Introduced overmap::get_default_terrain() which allows minor code deduplication and localization of a couple hard-coded terrain ids.
  • Tiny code improvements.

@codemime codemime force-pushed the codemime:fix_town_buildings branch to 410bfdf Jan 13, 2018

@kevingranade kevingranade merged commit 410bfdf into CleverRaven:master Jan 16, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.6%) to 22.678%
Details
gorgon-ghprb Build finished.
Details

@codemime codemime deleted the codemime:fix_town_buildings branch Jan 23, 2018

@Leland Leland referenced this pull request Feb 19, 2018

Closed

Weird road mapgen #22113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.