From ece8729e3f821017770926774bdd85b758432131 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Apr 2022 22:46:17 +0100 Subject: [PATCH] script: piece_raise: allow overriding the actual implementation We're going to need to do something else for multigrab. Signed-off-by: Ian Jackson --- templates/script.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index e55185a2..25f8162a 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -887,13 +887,18 @@ function raise_targets(uo: UoRecord) { } function piece_raise(piece: PieceId, p: PieceInfo, - new_held_us_raising: HeldUsRaising) { + new_held_us_raising: HeldUsRaising, + implement: (piece: PieceId, p: PieceInfo, z: ZCoord) => void + = function(piece: PieceId, p: PieceInfo, z: ZCoord) { + api_piece("setz", piece,p, { z: z }); + }) +{ p.held_us_raising = new_held_us_raising; piece_set_zlevel(piece,p, (oldtop_piece) => { let oldtop_p = pieces[oldtop_piece]!; let z = wasm_bindgen.increment(oldtop_p.z); p.z = z; - api_piece("setz", piece,p, { z: z }); + implement(piece,p,z); }); } -- 2.30.2