summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index cac9517..6f5743a 100644
--- a/rules.js
+++ b/rules.js
@@ -1053,8 +1053,7 @@ function set_force_inside(force) {
function is_piece_on_map(p) {
// TODO: militia boxes?
- let s = piece_node(p);
- return s !== 0;
+ return piece_node(p) !== 0;
}
function is_piece_unused(p) {
@@ -5880,8 +5879,14 @@ function can_place_in_space(s) {
}
function can_restore_unit(p) {
- // TODO: out-of-supply drilled troops
- return is_piece_on_map(p) && is_piece_unbesieged(p) && is_unit_reduced(p);
+ if (is_piece_on_map(p) && is_piece_unbesieged(p) && is_unit_reduced(p)) {
+ if (is_militia_unit(p))
+ return true; // always in militia box
+ if (is_drilled_troops(p))
+ return is_in_supply(piece_space(p));
+ return true;
+ }
+ return false;
}
function count_french_raids_in_dept(dept) {