spinners and fmt

This commit is contained in:
2026-06-21 01:32:47 -05:00
parent d32914d99d
commit 8e90084b53
31 changed files with 1445 additions and 284 deletions
+10 -3
View File
@@ -238,7 +238,9 @@ impl TryFrom<MapFile> for Board {
opaque: t.opaque,
pushable: t.pushable,
script_name: t.script_name,
builtin_script: t.builtin_script,
// Script-backed archetypes are expanded after the board is built
// (see `expand_builtin_archetypes` below), not via templates.
builtin_script: None,
tags: t.tags.into_iter().collect(),
name,
},
@@ -267,7 +269,7 @@ impl TryFrom<MapFile> for Board {
});
}
Ok(Board {
let mut board = Board {
name: mf.map.name,
width: w,
height: h,
@@ -282,7 +284,12 @@ impl TryFrom<MapFile> for Board {
board_script_name: mf.map.board_script_name,
load_errors,
registry: HashMap::new(),
})
};
// Turn script-backed archetype cells (pushers/spinners) into their scripted
// objects. Runs after the cross-layer validation above, so board invariants
// hold; the same call also fixes editor-placed machines before a playtest.
board.expand_builtin_archetypes();
Ok(board)
}
}