From 0cb8cba8b911fdf3f09984600b154544ee8dad50 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sun, 28 Jul 2024 16:23:35 +0200 Subject: [PATCH] Add test --- src/variety/icewalk.js | 14 +++++++------- test/script/firewalk.js | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/variety/icewalk.js b/src/variety/icewalk.js index 0e4761e0c..e6b94fe29 100644 --- a/src/variety/icewalk.js +++ b/src/variety/icewalk.js @@ -18,13 +18,6 @@ } else if (this.mouseend && this.notInputted()) { this.prevPos.reset(); this.inputpeke(); - if (this.pid === "firewalk" && this.notInputted()) { - this.prevPos.reset(); - this.inputdot(); - if (this.notInputted()) { - this.toggleArcs(); - } - } } } else if ( this.btn === "right" && @@ -32,6 +25,13 @@ ) { this.inputpeke(); } + if (this.pid === "firewalk" && this.mouseend && this.notInputted()) { + this.prevPos.reset(); + this.inputdot(); + if (this.notInputted()) { + this.toggleArcs(); + } + } } else if (this.puzzle.editmode) { var cell = this.getcell(); if ( diff --git a/test/script/firewalk.js b/test/script/firewalk.js index 5f43a5f98..ccb9921e4 100644 --- a/test/script/firewalk.js +++ b/test/script/firewalk.js @@ -78,6 +78,11 @@ ui.debug.addDebugData("firewalk", { input: ["mouse,left,1,3,5,3"], result: "pzprv3/firewalk/3/3/. . . /. # . /. . . /0 0 1 0 /0 0 0 0 /0 1 0 0 /0 0 0 /0 1 0 /0 1 0 /0 0 0 /" + }, + { + input: ["mouse,left,2,2", "mouse,right,4,2"], + result: + "pzprv3/firewalk/3/3/. . . /. # . /. . . /0 0 1 0 /0 0 0 0 /0 1 0 0 /0 0 0 /0 1 0 /0 1 0 /0 0 0 /0 0 0 0 /0 1 2 0 /0 0 0 0 /0 0 0 0 /" } ] });