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 NPC positioning in mapgen #20700

Merged
merged 2 commits into from Apr 2, 2017

Conversation

Projects
None yet
3 participants
@Coolthulhu
Copy link
Contributor

commented Mar 27, 2017

Closes #20654
Closes #20684

Also improved the rotation code, should be easier to understand what is happening.
Well, improved readability - to make it more robust, I made it use a significantly slower method of re-placing NPC - instead of simply moving the NPC, it deletes it from overmap and then places it again, which is linear with total number of NPCs in the overmap buffer. This isn't a big deal though, as NPCs dying also take this much time. If it ever becomes a big deal, I'll optimize it.

Split spawn_at into two functions:

  • spawn_at_sm does what spawn_at did before
  • spawn_at_precise places a NPC at given submap+position, essentially doing spawn_at+setpos

setpos can no longer be used at mapgen time.

@Toothspit

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2017

Refugee center's fixed; I might be doing something wrong, but this places the starting NPC 3 tiles NW of the evac shelter.

Linux gcc tiles 64 your npc-pos-fix branch here's a save.

@Coolthulhu Coolthulhu force-pushed the cataclysmbnteam:npc-pos-fix branch to 0d5a9cf Mar 29, 2017

@Coolthulhu

This comment has been minimized.

Copy link
Contributor Author

commented Mar 29, 2017

Used wrong coords. Should be fixed now - I placed the NPC closer to the player to make sure all locations are "safe" (ie. that some weird lab config will not move the NPC into a locked closet).
Double checked the rest of the coords - the rest use more specific coords and so should be fine.

@kevingranade kevingranade merged commit 0d5a9cf into CleverRaven:master Apr 2, 2017

1 check passed

default
Details
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.