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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user