diff --git a/scenes/ai/decision.gd b/scenes/ai/decision.gd index deec5e0..dd63fac 100644 --- a/scenes/ai/decision.gd +++ b/scenes/ai/decision.gd @@ -41,14 +41,21 @@ static func pick_next_job(pawn, work_providers: Array) -> Job: # ── Layer 4: Work providers ────────────────────────────────────────────── # Needs-driven categories are handled entirely by Layer-3 status interrupts - # and need-threshold providers (rest/eat/sleep/doctor fire when hunger/sleep + # and need-threshold providers (eat/sleep/doctor fire when hunger/sleep # thresholds trigger, not via player priority). We skip the priority filter # for them so a pawn can never accidentally starve because the player set # &"eat" to OFF. The player-configurable list is the 7 work categories: # construction / chop / plant / mine / crafting / haul / clean # Doctor IS in the matrix (player can opt a pawn out of doctor duty) but # the needs-driven "go heal yourself" path bypasses this filter at Layer 3. - const NEEDS_CATEGORIES: Array = [&"rest", &"eat", &"sleep"] + # + # Rest is NOT a need-gated category — RestProvider always returns a job (its + # job IS "stand here"), so if rest ran before elective work, pawns would + # never chop/mine/build. Rest is the eligible-bucket fallback: it sorts last + # because provider.priority=0, so any real work wins. Bug ref: 2026-05-12 + # session — pawns idled with valid chop/mine/build designations because + # &"rest" was in NEEDS_CATEGORIES and RestProvider preempted everything. + const NEEDS_CATEGORIES: Array = [&"eat", &"sleep"] # Pawn's work_priorities dict — empty dict if the field is absent (pre-Phase-17 # pawns loaded from old saves). Missing category key defaults to 3 (NORMAL) so