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 item auto pickup for npc #76532

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

phelieros
Copy link

Summary

Bugfixes "NPC not automatically picking up items from their filter list"

Purpose of change

Fix #76377

Describe the solution

Tweak npc::is_stationary condition to exclude NPCs that have active mission NPC_MISSION_SHELTER and are actively following player.

Describe alternatives you've considered

Arguably !is_following can be used as a separate condition instead, in addition to three existing ones separated by ORs, but I don't have clear understanding on whether mission == NPC_MISSION_SHOPKEEP and has_effect( effect_infection ) should also be affected by it. For the first one it would probably be excessive, for the second one I'm not certain, so I decided to not touch the other two.

Testing

Tested on experimental abbb6ce and on 0.H c6ba9a2.

Additional context

NPC item pick up can still be quite inconsistent and not work immediately after updating the list due to npc's caching the tiles they already looked at introduced in #33885, but this seems like a problem outside of scope of this issue.

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) new contributor labels Sep 18, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Sep 18, 2024
phelieros added a commit to phelieros/Cataclysm-DDA that referenced this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions new contributor NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-pick up feature doesn't work for NPC
1 participant