Cataclysm-dda: NPC doesn't build second stage constructions

Created on 11 Nov 2019  路  2Comments  路  Source: CleverRaven/Cataclysm-DDA

When ordering an NPC to build constructions via blueprints they won't build further stages than the first if applicable. Tested with chainlink fence and windows, confirmed it's NOT due to lack of skill, resources or tools. Chainlink fence demonstrates this bug nicely/

Steps To Reproduce

  1. Set up a construction blueprint zone for chainlink fence with enough resources to complete both steps.
  2. Chat with NPC. 'i' then 'd' to get them constructing.
  3. Watch them finish the metal post then stop.
  4. Repeat step 2 ad nauseum or until you're satisfied it's a bug.

Expected behavior

NPCs should check to see if they can build any other stages in the construction. I assume at this point they check to see if a construction matching the blueprint is present and if it is they skip it. I can't think of any cases where you'd want to only build one stage but having the option is probably desirable.

  • OS: Windows

    • OS Version: MINGW/CYGWIN/MSYS2 on unknown Windows version

  • Game Version: 0.D-9308-g1d6366e [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Aftershock [aftershock],
    C.R.I.T Expansion Mod [crt_expansion],
    Magiclysm [magiclysm],
    Makeshift Items Mod [makeshift],
    More Survival Tools [More_Survival_Tools],
    Mythological Replicas [nw_pack],
    Hydroponics [hydroponics],
    Mutant NPCs [mutant_npcs],
    No Rail Stations [No_Rail_Stations],
    Folding Parts pack [deoxymod],
    Vehicle Additions Pack [blazemod],
    Tanks and Other Vehicles [Tanks],
    Roadheader and other mining vehicles [Heavy miners],
    Disable NPC Needs [no_npc_food],
    No Fungal Monsters [No_Fungi]
    ]
<Bug> Crafting / Construction / Recipes NPC / Factions

All 2 comments

@ipcyborg any ideas?

I think the reason is npc::revert_after_activity().

UPD:
No, it is actually the same for both NPC and player.
The issue is in the Chainlink fence construction - it has 2 stages:

  1. Metal post
  2. Chainlink fence

Compare to 'Build Fence post / Build Fence' (two different construction, works fine).
So the issue is in the "detecting the final construction" algorithm blueprint_options::get_final_construction. It incorrectly decides that the first stage is the final.

Trying to fix this.

Was this page helpful?
0 / 5 - 0 ratings