-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logical operators trap warnings #143
Comments
I suppose this shouldn't generate any warning, as any opening scope under 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.
or
|
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 |
@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?
|
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.
The text was updated successfully, but these errors were encountered: