From d1de641d348d88ae6b0b075794f995b6db1bd3f1 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 Mar 2026 20:47:35 +0000 Subject: [PATCH] fix: ensure social and industry systems handle drink/forage goals Add drink/forage to isTargetBusy in socialSystem so NPCs drinking or foraging are not interrupted by social interactions. Add drink/forage to the industry system goal skip list so it doesn't override those goals. Co-Authored-By: Claude Opus 4.6 --- server/src/systems/industrySystem.ts | 2 +- server/src/systems/socialSystem.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/systems/industrySystem.ts b/server/src/systems/industrySystem.ts index 6270338..d71b5eb 100644 --- a/server/src/systems/industrySystem.ts +++ b/server/src/systems/industrySystem.ts @@ -84,7 +84,7 @@ export function industrySystem(world: World, map: GameMap): void { if (brain.currentGoal === 'craft' && world.getComponent(entity, 'craftingState')) continue; if (brain.currentGoal === 'build' && world.getComponent(entity, 'buildingState')) continue; if (brain.currentGoal === 'gather' && world.getComponent(entity, 'gatheringState')) continue; - if (brain.currentGoal === 'gather' || brain.currentGoal === 'eat' || brain.currentGoal === 'sleep') continue; + if (brain.currentGoal === 'gather' || brain.currentGoal === 'eat' || brain.currentGoal === 'sleep' || brain.currentGoal === 'drink' || brain.currentGoal === 'forage') continue; if (brain.currentGoal === 'dropoff') continue; if (brain.currentGoal === 'pickup') continue; diff --git a/server/src/systems/socialSystem.ts b/server/src/systems/socialSystem.ts index 8ee48f3..9edfd65 100644 --- a/server/src/systems/socialSystem.ts +++ b/server/src/systems/socialSystem.ts @@ -36,7 +36,9 @@ function isTargetBusy(world: World, target: EntityId, rc: RuntimeConstants): boo const needs = world.getComponent(target, 'needs'); if (!needs) return false; if (brain.currentGoal === 'eat' && needs.hunger < rc.get('HUNGER_THRESHOLD')) return true; + if (brain.currentGoal === 'drink' && needs.thirst < rc.get('THIRST_THRESHOLD')) return true; if (brain.currentGoal === 'sleep' && needs.energy < rc.get('ENERGY_THRESHOLD')) return true; + if (brain.currentGoal === 'forage') return true; return false; }