summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-03 11:53:18 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-03 11:53:18 +0100
commita7bc2625f18d207d1544c984c885057381cb2549 (patch)
tree519e5e5894186f7bacdc93c97fc2566a24f9f55d
parent621e01f4993ac178f18d1f206fcf600d122fde86 (diff)
downloadalgeria-a7bc2625f18d207d1544c984c885057381cb2549.tar.gz
fix OAS suppression mission
-rw-r--r--rules.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 4ab5cbb..6679f3a 100644
--- a/rules.js
+++ b/rules.js
@@ -862,6 +862,12 @@ function for_each_enemy_unit_in_loc(loc, fn) {
fn(u)
}
+function for_each_non_neutralized_fln_unit_in_loc(loc, fn) {
+ for (let u = first_fln_unit; u <= last_fln_unit; ++u)
+ if (is_unit_not_neutralized(u) && unit_loc(u) === loc)
+ fn(u)
+}
+
function count_friendly_units_on_map_of_type(type) {
let count = 0
for (let u = first_friendly_unit; u <= last_friendly_unit; ++u)
@@ -4745,7 +4751,7 @@ function do_suppression(loc, add_elite=false) {
// no matter what box they are in (FLN player chooses which exact units are neutralized).
let targets = []
- for_each_enemy_unit_in_loc(loc, u => {
+ for_each_non_neutralized_fln_unit_in_loc(loc, u => {
let type = unit_type(u)
if (type === BAND || type === FAILEK) {
targets.push(u)