Open HiddeLekanne opened 1 month ago
I suppose this shouldn't generate any warning, as any opening scope under trigger context
includes an implicit AND
, and all paradox games (not only CK3 or Vic3 but also EU4 and so on) has the same behavior.
And, if you DO want to do a scope switch, you can either swap the scope and logic operate scope, or add another logic operate scope, e.g.
c:GER = {
OR = {
gdp >= 10000
total_population >= 800000
}
}
or
OR = {
c:GER = {
OR = {
gdp >= 10000
total_population >= 800000
}
}
c:AUS = { gdp <= 10000 }
}
I think this can be covered under a more general warning about an OR with only one item in it. Your first example would trigger such a warning. I don't think the other example is clear enough to merit a warning; it could easily be the intended code.
An OR (or an AND) with only one item in it is a minor performance issue and might indicate there is a bug there because of an uncompleted thought. Perhaps a warning at untidy
level.
@amtep I am confused, is there currently a one item rule? If so, the current tool doesn't detect this code from vanilla when we added it to our mod. This should trigger the one item in OR right?
OR = {
owner = {
has_law = law_type:law_regulatory_bodies
has_law = law_type:law_worker_protections
}
}
Yes I meant we could add one :)
In vic3 (and I suspect in other games) if you scope inside a logical operate scope (such as OR) it will default back to AND. A somewhat common mistake I see is this:
Where the modder wants to do a scope switch, but tries to do it inside the logical operator instead of the other way around.
In the case of a single object it is clearly a mistake. So that is easy to solve.
However, there are legimate uses of objects inside logical operators, clearly when the scope within has just a single item:
But unclear when there appears to be a use for the OR.
So I don't know if that one is solvable except by forcing the modder to be pendantic and add another AND inside.