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 zone rotation in faction camp farms #51703

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

eltank
Copy link
Contributor

@eltank eltank commented Sep 19, 2021

Summary

Bugfixes "Fix zone rotation in faction camp farms"

Purpose of change

Fixes #51459 - player-defined zones in basecamp farm OMTs get rotated when interacting with the bulletin board.

Describe the solution

Avoid calling map::generate on the tinymap loaded from the farm OMT. Use fake_map instead and call mapgen directly, using mapgendata extracted from the farm OMT.
Refactor fake_map to make it easier to use (no-arg constructor, hardcoded z-level).
Revert the no_rotate_npcs workaround from #47730.

Describe alternatives you've considered

Implement something similar to get_changed_ids_from_update() (mapgen.cpp) that runs mapgen in a fake_map and returns terrain/furniture data in std::map format.

Refactor mapgen code to not rotate maps, but rather transform the coordinates of the json template before applying modifications to the map. I think bugs of this nature will continue to crop up until this is done.

Testing

Load the save from the bug. Inspect the bulletin board. Open zone manager and check that zones have not moved. Also the follower NPCs are still in the same places.

image

Build a field base camp with a farm, plow and plant seeds from the camp menu.

image

Additional context

While testing I discovered that the "type 2" farm for the field base camp is broken (missing the "farming" capability) so I'll fix that in another PR.

@actual-nh actual-nh added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones Player Faction Base / Camp All about the player faction base/camp/site labels Sep 19, 2021
@eltank eltank marked this pull request as ready for review September 19, 2021 10:53
@I-am-Erk I-am-Erk merged commit c5df995 into CleverRaven:master Sep 20, 2021
@eltank eltank deleted the fix_zone_rotation branch September 20, 2021 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones Player Faction Base / Camp All about the player faction base/camp/site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessing the bulletin board in a mansion base rotates zones around the camp's center.
3 participants