Skip to content

Commit 08bc046

Browse files
committed
fix war_countries not being an iterator
also vacuous truth fix
1 parent 16e1429 commit 08bc046

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/openvic-simulation/scripts/Condition.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ bool ConditionNode::evaluate_group(Context const& context) const {
8080
return false;
8181
}
8282

83-
const bool is_iterator = id.starts_with("any_") || id.starts_with("all_");
83+
const bool is_iterator = id.starts_with("any_") || id.starts_with("all_") || id == "war_countries";
8484

8585
if (is_iterator) {
8686
const bool require_all = id.starts_with("all_");
8787

8888
auto sub_contexts = context.get_sub_contexts(id, target_scope);
8989

9090
if (require_all) {
91-
if (sub_contexts.empty()) return false;
91+
if (sub_contexts.empty()) return true; // vacuous truth
9292
for (auto const& sub : sub_contexts) {
9393
for (auto const& node : children) {
9494
if (!node.evaluate(sub)) return false;

0 commit comments

Comments
 (0)