summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/rules.js b/rules.js
index b43daef..204575c 100644
--- a/rules.js
+++ b/rules.js
@@ -344,19 +344,23 @@ function set_next_player() {
}
function blow_unit(p, n) {
- if (game.turn + n > 8) {
- log("P" + p + " eliminated.")
- set_piece_hex(p, ELIMINATED)
- } else {
- log("P" + p + " blown.")
- set_piece_hex(p, BLOWN + game.turn + n)
- set_piece_mode(p, 0)
+ if (piece_is_on_map(p)) {
+ if (game.turn + n > 8) {
+ log("P" + p + " eliminated.")
+ set_piece_hex(p, ELIMINATED)
+ } else {
+ log("P" + p + " blown.")
+ set_piece_hex(p, BLOWN + game.turn + n)
+ set_piece_mode(p, 0)
+ }
}
}
function eliminate_unit(p) {
- log("P" + p + " eliminated.")
- set_piece_hex(p, ELIMINATED)
+ if (piece_is_on_map(p)) {
+ log("P" + p + " eliminated.")
+ set_piece_hex(p, ELIMINATED)
+ }
}
function eliminate_detachments_stacked_with_corps(c) {