From: Ian Jackson Date: Sun, 26 Jun 2022 01:28:46 +0000 (+0100) Subject: script: Builtin per-piece actions properly uniqueness tested X-Git-Tag: otter-1.2.1~3 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=99af52651d00c9264dc2a4ae0c04da0e8d779943;p=otter.git script: Builtin per-piece actions properly uniqueness tested Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 454a9921..57b95c7b 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -348,9 +348,9 @@ function recompute_keybindings() { } all_targets.sort(pieceid_z_cmp); let add_uo = function(targets: PieceId[] | null, uo: UoDescription) { - uo_map[uo.def_key] = { - targets: targets, - ...uo + let currently = prep_add_uo(uo); + if (currently) { + currently.targets = targets; }; }; if (all_targets.length) {