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 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-10 20:47:35 +00:00
parent 1cb0570a49
commit d1de641d34
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ export function industrySystem(world: World, map: GameMap): void {
if (brain.currentGoal === 'craft' && world.getComponent<CraftingState>(entity, 'craftingState')) continue;
if (brain.currentGoal === 'build' && world.getComponent<BuildingState>(entity, 'buildingState')) continue;
if (brain.currentGoal === 'gather' && world.getComponent<GatheringState>(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;
+2
View File
@@ -36,7 +36,9 @@ function isTargetBusy(world: World, target: EntityId, rc: RuntimeConstants): boo
const needs = world.getComponent<Needs>(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;
}