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] Overmap point refactoring + some bugfixes #1053

Merged
merged 6 commits into from
Oct 23, 2021

Conversation

olanti-p
Copy link
Contributor

@olanti-p olanti-p commented Oct 14, 2021

Port of DDA overmap point refactor CleverRaven/Cataclysm-DDA#41693, which should be the last major blocker on the road to the SDL overmap.

Includes related PRs:
CleverRaven/Cataclysm-DDA#41787
CleverRaven/Cataclysm-DDA#45291
CleverRaven/Cataclysm-DDA#42317

Bugs fixed by the original PR:

  1. Refugee shelter terminal now correctly calculates distance & direction to refugee center
  2. It is now possible to deactivate Magiclysm translocators
  3. Hordes now properly calculate movement chance depending on overmap tile
  4. Fixed generation of slime pits in southern and eastern parts of an overmap

Additionally fixed faction camp distribution of food in containers: litter placement mixed up coord types, which caused food containers to be placed outside map boundaries, which triggered debugmsgs ever since #562. Changed it so distrubuting food now takes food out and leaves containers in place.

TODO:

  • Review it
  • Satisfy CI
  • Look for related old bugs in DDA tracker
  • Playtesting

kevingranade and others added 6 commits October 19, 2021 16:06
(cherry picked from commit 3234649478f9252beff6551d0cf731fafd028951)
Put the new point types through their paces by changing the types for
overmap and overmapbuffer, and dealing with all the consequent fallout.

Involves more changes than I originally anticipated, but serves as a
good demonstration of the new point type features.

Fixed some bugs along the way that were discovered by this new point
type safety.  The ones I remember are:
* The evacuation shelter now correctly calculates the distance and
  direction to the refugee center, previously it was mostly nonsense
  (this only affects the message it prints out).
* Weather conditions for NPC-planted crops are calculated more
  reasonably.  Previously they were passing an overmap location as a
  map-square location, which could have caused all sorts of strangeness.
* Translocators were similarly confusing map_square and overmap_terrain
  scales, so they might not have been working properly.
* Two places were using map::points_in_radius which truncates to the map
  boundaries, but were using it for overmap-scale points, so it would
  only have worked correctly for some regions of the overmap.

(cherry picked from commit 3c67e804d7ba0095fc71c09df6abd487ce785b00)
Refactoring in #41693 accidentally introduced an out-of-bounds array
access in overmapbuffer::scents_near.  Fix it.

(cherry picked from commit 3783a24141951d82647b61dc8863dcce29bf2a45)
When working on #41693 I totally forgot that I'd added shorter names for
the various coord::scale values to use in project_to etc. without being
so verbose.

This makes the API more consistent because the names of the scales match
the abbreviations in the type names.

Convert to the shorter names.

Strictly a find-and-replace commit, so hopefully should be safe.

(cherry picked from commit ab7a370c5055857c7c817a6815cf2e5086b6dfa9)
@olanti-p olanti-p changed the title [WIP] [DDA Port] Overmap point refactoring [DDA Port] Overmap point refactoring + some bugfixes Oct 19, 2021
@olanti-p
Copy link
Contributor Author

Ready.

@Coolthulhu Coolthulhu self-assigned this Oct 21, 2021
@Coolthulhu
Copy link
Member

I'm testing many PRs at once, so it may be some other thing, but I'm getting debugmsgs about labs in my save.
Will try with a fresh world.

@Coolthulhu
Copy link
Member

Alright, it seems to be an one-time thing. Couldn't replicate it.

@Coolthulhu Coolthulhu merged commit 4e76130 into cataclysmbnteam:upload Oct 23, 2021
@olanti-p olanti-p deleted the overmap-types branch October 23, 2021 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants