Clear up item ownership for dead factions #38334
Merged
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 "Clear up item ownership for dead factions"
Purpose of change
Fixes #37339
Fixes #38225
Describe the solution
When an NPC drops an item, their ownership is still on it.
when they die, ownership is cleared on all their inventory, but the world may be scattered with items they dropped earlier, this validates this check for a dead faction when its owner is requested.
Describe alternatives you've considered
N/A
Testing
Spawned an NPC, told them to drop their weapon, then killed them, their weapon no longer produced a debugmsg about a non-existent faction., and itwas available to pick up as it now had no owner.
Additional context
N/A