Stop NPCs getting confused by stashed outbounds activities #36316
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.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "Stop NPCs getting confused by stashed outbounds activities"
Purpose of change
Fix NPCs standing around and not doing activity.
Describe the solution
#36166 was a bug where NPCs believed pulping a corpse was out of bounds of the current map, they then stashed that activity, so any people whos saves were caught up in that bug, had NPCs with that stashed activity, and in the NPC AI it checked if their mission was MISSION_ACTIVITY, which it was when you assigned them a new activity, but it found they had one already stashed, ( the pulping ) but its targets were still outbounds, therefore it set moves to 0 and did nothing , thinking that they had just been loaded into reality bubble but the corpse was not.
This shouldnt happen anymore, but for those people whos saves are affected by this still, and to hopefully avoid similar problems in future, ive cleared the stashed activity when a new activity is assigned.
they now go and do vehicle deconstruction, the save I tested on i shere. https://www.reddit.com/r/cataclysmdda/comments/ec7jww/new_players_come_here_weekly_questions_and/fbh9z2z/
Ive also neatened up the set_mission() and set_attitude() everywhere that activities are assigned, as that is encapsulated in character::assign_activity() anyway.,
Describe alternatives you've considered
N/A
Testing
save in linked reddit report - now the NPC goes and does the deconstruction when prompted.
Additional context
N/A