sprint cleanup: corpse_cremated signal, recipe_count, save_system

D: Workbench._last_consumed_ingredient transient field captures the
carried item before queue_free so cremation_pyre.on_craft_complete can
emit corpse_cremated with the real ref. Falls back to proximity scan.
Pawn._on_corpse_cremated null-guarded.

E: removed redundant r.ingredient_count = 0 from recipe_catalog. Field
kept on Recipe for save round-trip compat; nothing reads it functionally.

F: save_system._spawn_workbench simplified from 15 lines to 6 — let
from_dict do all field restoration. Fixed workbench.from_dict to call
_complete() instead of bare _completed=true, which was skipping light
enable + beauty register + designation clear.

Stale ingredient1/2 buffering comment in job_runner._tick_craft fixed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-05-16 18:23:22 +01:00
parent 2afca16299
commit cc6d60d044
6 changed files with 29 additions and 18 deletions

View file

@ -493,18 +493,10 @@ func _spawn_door(world_scene: Node, d: Dictionary) -> void:
func _spawn_workbench(world_scene: Node, d: Dictionary) -> void:
var ent = _WORKBENCH_SCENE.instantiate()
world_scene.add_child(ent)
ent.setup(Vector2i(int(d.get("tile_x", 0)), int(d.get("tile_y", 0))))
if d.has("label_text"):
ent.label_text = str(d["label_text"])
if d.has("accepted_skill"):
ent.accepted_skill = StringName(d["accepted_skill"])
ent.build_progress = int(d.get("build_progress", 0))
if bool(d.get("completed", false)):
ent.build_progress = ent.BUILD_TICKS
ent.on_build_tick()
# from_dict restores bills + any other Workbench-specific state.
if ent.has_method("from_dict"):
ent.from_dict(d)
# from_dict restores all fields (label_text, accepted_skill, build_progress,
# bills, deposited_inputs) and calls _complete() + setup() internally.
# No manual field assignment needed here.
ent.from_dict(d)
func _spawn_crop(world_scene: Node, d: Dictionary) -> void: