Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upFix NPC positioning in mapgen #20700
Conversation
This comment has been minimized.
This comment has been minimized.
|
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
added some commits
Mar 27, 2017
Coolthulhu
force-pushed the
cataclysmbnteam:npc-pos-fix
branch
to
0d5a9cf
Mar 29, 2017
This comment has been minimized.
This comment has been minimized.
|
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). |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Coolthulhu commentedMar 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_atinto two functions:spawn_at_smdoes whatspawn_atdid beforespawn_at_preciseplaces a NPC at given submap+position, essentially doingspawn_at+setpossetposcan no longer be used at mapgen time.