CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.31k stars 4.14k forks source link

Items used by PC can be sorted away by NPC #38459

Open Funguss opened 4 years ago

Funguss commented 4 years ago

This is most obvious when butchering but I suspect it would apply in other situations, e.g. crafting or construction, or if the roles are reversed (PC sorting and NPC butchering). If an NPC is set to sort items and the player is butchering a corpse that is in an unsorted zone, the corpse can be moved. The player continues butchering until the task is complete, at which point an error is thrown.

Steps To Reproduce

  1. Place corpse in unsorted loot zone with a corpse loot zone nearby.
  2. Tell NPC to sort items (ensure they won't be able to move the corpse before step 3)
  3. Butcher corpse.

Expected behavior

This was an unusual situation and wouldn't likely come up often, but I expect with future changes it could become more frequent and annoying.

The best fix I can come up with is tagging items, tools and furniture that are being used in an activity (woodcutting, construction, crafting, etc.) as being "in use". Any attempt to move these items will need a corresponding flag which allows this. Items tagged as "in use" should update the activity with a warning message when the items are lost or destroyed, prompting the player to cancel or continue using a different object, where appropriate.

Versions and configuration

Additional context

ghost commented 4 years ago

Yeah, I can add the same kinda scan I do for NPC vehicle deconstruction, to sorting, so that they scan all other NPCs and player activity targets in the area, to ensure its not being worked on before they sort it.

Ill do that today if possible.