feat: add physical animal care delivery

This commit is contained in:
Rijad Zuzo
2026-07-31 00:19:41 +02:00
parent 7d410d8193
commit ead75fca68
25 changed files with 1469 additions and 191 deletions
+9 -1
View File
@@ -473,11 +473,19 @@ static func _is_valid_animal_feed_event(
var animal := (
animal_records_by_id.get(StringName(event.data["destination_id"])) as AnimalStateRecord
)
var source_id := StringName(event.data["source_id"])
var has_valid_source := source_id == SimulationIds.STORAGE_VILLAGE_PANTRY
if actor_id >= 0:
# Existing v11 saves contain direct pantry-to-animal NPC feed facts.
# New physical deliveries name the matching carried inventory instead.
has_valid_source = (
has_valid_source or source_id == SimulationIds.npc_inventory_id(actor_id)
)
return (
(actor_id == -1 or npc_ids.has(actor_id))
and int(event.data["tick"]) <= current_tick
and animal != null
and StringName(event.data["source_id"]) == SimulationIds.STORAGE_VILLAGE_PANTRY
and has_valid_source
and storage_records_by_id.has(SimulationIds.STORAGE_VILLAGE_PANTRY)
and StringName(event.data["item_id"]) == SimulationIds.RESOURCE_FOOD
and definition != null