summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-12 16:05:41 +0200
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-12 16:05:41 +0200
commitb19d26cfcb0a3d28802554edc7510257917f2a43 (patch)
tree29e06bce256b2ff686f9a98b0c3e64aa725d94c8 /rules.js
parent752864ec3d2b1cec6840177b1e7e44f251adfd93 (diff)
downloadalgeria-b19d26cfcb0a3d28802554edc7510257917f2a43.tar.gz
unused vars and asserts
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index e79c76c..5ac85a6 100644
--- a/rules.js
+++ b/rules.js
@@ -608,7 +608,6 @@ function is_flush_unit(u) {
}
function is_react_unit(u) {
- let loc = unit_loc(u)
// TODO airmobile && division
return is_mobile_unit(u) && is_unit_not_neutralized(u)
}
@@ -1916,6 +1915,9 @@ function build_fln_unit(type, where) {
let cost = build_cost(type, where)
game.fln_ap -= cost
log(`>Paid ${cost} AP`)
+ if (game.fln_ap < 0) {
+ throw new Error("ASSERT game.fln_ap < 0")
+ }
}
function convert_fln_unit(u, type) {
@@ -1928,6 +1930,9 @@ function convert_fln_unit(u, type) {
let cost = convert_cost(type)
game.fln_ap -= cost
log(`>Paid ${cost} AP`)
+ if (game.fln_ap < 0) {
+ throw new Error("ASSERT game.fln_ap < 0")
+ }
}
states.fln_reinforcement = {