summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-11 16:40:17 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-11 16:40:17 +0200
commit2f2060971094e7e5f952a15da503eafd58308cf1 (patch)
treeefd3500feaab7dd8905e13c56c7e57bae96849f0
parentcf0fbb65a29621023494413344186e026d505a78 (diff)
downloadandean-abyss-2f2060971094e7e5f952a15da503eafd58308cf1.tar.gz
Fix "place or remove insurgent base" event.
... when trying to place a base from elsewhere
-rw-r--r--rules.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index a7b7fde..36605e5 100644
--- a/rules.js
+++ b/rules.js
@@ -7916,12 +7916,12 @@ states.vm_place_or_remove_insurgent_base = {
},
piece(p) {
push_undo()
- if (piece_space(p) === AVAILABLE) {
- log("Placed " + piece_name(p) + " in S" + game.vm.s + ".")
- place_piece(p, game.vm.s)
- } else {
+ if (piece_space(p) === game.vm.s) {
log("Removed " + piece_name(p) + " from S" + game.vm.s + ".")
remove_piece(p)
+ } else {
+ log("Placed " + piece_name(p) + " in S" + game.vm.s + ".")
+ place_piece(p, game.vm.s)
}
vm_next()
},