summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-09-03 13:51:25 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commit036468db8d980af582daa9ad020eb8c189309056 (patch)
tree21f33bf6d283e316e33b6b9b5ba7601e1e3f8283
parenta9edc45cec9971475f236f064c6e35fab6a44b80 (diff)
downloadrommel-in-the-desert-036468db8d980af582daa9ad020eb8c189309056.tar.gz
Bugs.
-rw-r--r--rules.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 823562b..83f2d32 100644
--- a/rules.js
+++ b/rules.js
@@ -3191,7 +3191,7 @@ function search_current_move(who, is_retreat) {
let speed = unit_speed[who]
if (game.turn_option !== 'pass') {
if (is_retreat)
- search_move_retreat(who, speed + 1 + (rommel1 | rommel2))
+ search_move_retreat(from, speed + 1 + (rommel1 | rommel2))
else
search_move(from, speed + 1 + (rommel1 | rommel2))
} else {
@@ -3295,7 +3295,7 @@ states.move = {
// Select Regroup Move 1
if (game.to1) {
for_each_hex_and_adjacent_hex(game.from1, from => {
- if (!has_enemy_unit(from)) {
+ if (!has_enemy_unit(from) && from !== game.to1) {
let fastest = fastest_undisrupted_and_unmoved_friendly_unit_in_hex(from)
if (fastest >= 0) {
search_current_move(fastest, false)
@@ -3311,7 +3311,7 @@ states.move = {
// Select Regroup Move 2
if (game.to1) {
for_each_hex_and_adjacent_hex(game.from2, from => {
- if (!has_enemy_unit(from)) {
+ if (!has_enemy_unit(from) && from !== game.to2) {
let fastest = fastest_undisrupted_and_unmoved_friendly_unit_in_hex(from)
if (fastest >= 0) {
search_current_move(fastest, false)