feat: enforce activity site capacity

This commit is contained in:
2026-07-07 16:12:13 +02:00
parent 9d87372a15
commit 1c389ec23d
7 changed files with 87 additions and 26 deletions
+12
View File
@@ -395,6 +395,18 @@ func synchronize_npc_position(npc_id: int, active_position: Vector3) -> bool:
return false
func get_activity_target_claim_count(target_id: StringName, except_npc_id: int = -1) -> int:
var count := 0
for npc in npcs:
if npc.id == except_npc_id or npc.is_dead:
continue
if npc.target_id != target_id:
continue
if npc.task_state in [SimNPC.TASK_STATE_TRAVELING, SimNPC.TASK_STATE_WORKING]:
count += 1
return count
func _npc_inventory_id(npc_id: int) -> StringName:
return StringName("npc_%d_inventory" % npc_id)