summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight
diff options
context:
space:
mode:
Diffstat (limited to 'lib/colonial_twilight')
-rw-r--r--lib/colonial_twilight/fln_bot_rules.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/colonial_twilight/fln_bot_rules.rb b/lib/colonial_twilight/fln_bot_rules.rb
index a5e5540..6f83def 100644
--- a/lib/colonial_twilight/fln_bot_rules.rb
+++ b/lib/colonial_twilight/fln_bot_rules.rb
@@ -151,8 +151,9 @@ module ColonialTwilight
end
def rally_9_priority(spaces, resources, &is_rallied)
- f = _filter(spaces) { |s| s.support? && (resources.zero? || (resources - (is_rallied.call(s) ? 0 : 1)) > s.terror) }
- _filter(f) { |s| s.neutral? && (resources.zero? || (resources - (is_rallied.call(s) ? 0 : 1)) > s.terror) }
+ has_resources = ->(s) { resources.zero? || (resources - (is_rallied.call(s) ? 0 : 1)) > s.terror }
+ f = _filter(spaces) { |s| s.support? && has_resources.call(s) }
+ _filter(f) { |s| s.neutral? && has_resources.call(s) }
end
# Extort