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 pulping #36219

Merged
merged 2 commits into from Dec 18, 2019
Merged

Fix NPC pulping #36219

merged 2 commits into from Dec 18, 2019

Conversation

ghost
Copy link

@ghost ghost commented Dec 18, 2019

Summary

SUMMARY: Bugfixes "Fix NPC pulping"

Purpose of change

Fixes #36166

Describe the solution

#35649 introduced outbounds checking for NPC activities, so they could stash their activity and resume it properly when entering/leaving reality bubble, without encountering infinite loops.

This relied on activity.placement being abs coords, ( because of submap shifting, when NPCs arent very close to you ), and most NPC activities used abs coords for activity.placement for precisely this reason.

ACT_PULP however , used local co-ord,s so when the outbounds activity checking ran getlocal on that coord, it counted as out bounds, and therefore the activity was stashed, but then restarted immediately the next turn, ad infinitum.

Ive changed the act.placement to abs for player and NPC, this should be more robust anyway, any activity that an NPC can do should be using abs coords to target and place things, because they sometimes wont be in the same submap as player.

Describe alternatives you've considered

There are probably other activities that need converting to abs, that may have problems too, I can look into this next.

Testing

Made a zombie corpse, NPC expressed their desire to smash it, they then stood over it doing nothing forever.

AFter this fix - the activity completes as expected.

Additional context

N/A

@I-am-Erk I-am-Erk added <Bugfix> This is a fix for a bug (or closes open issue) NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` labels Dec 18, 2019
@ZhilkinSerg ZhilkinSerg merged commit 5c5a4bb into CleverRaven:master Dec 18, 2019
@ghost ghost deleted the npc_pulp_fix branch December 19, 2019 14:15
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` NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPC(s) do not pulp corpses while following player, nor follow player after.
2 participants