You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't visit if/else blocks that have unreachable limits #280
This is mostly useful for script inside scripted effects and such. If an effect has
if = {
limit = { $COUNT$ == 1 }
...
}
then there is no need to validate the rest of the block if COUNT is known to not be 1. Avoiding this validation not only saves time, it can suppress some useless warnings that would never be reached anyway, for example the use of scopes that are only set by callers that do pass COUNT = 1.
Implementation: the trigger validation functions would have to return a tri-bool (yes, no, maybe) to indicate whether a trigger is known true, known false, or indeterminate (the usual case). Probably the only cases we need to evaluate for truth are comparison of literal boolean, flag, and numerical values, and comparisons involving always. The logic of NOT, AND, OR, etc then has to be applied, and finally the if/else validation has to become more robust by among other things skipping the else branch if the if branch was always true.
Question: should there be a warning about always true / always false limits that are not in macros?
changed the title [-]Don't vieit if/else blocks that have unreachable limits[/-][+]Don't visit if/else blocks that have unreachable limits[/+]on Sep 3, 2025
There are tons of instances of this trigger in vanilla and usually similar ratio in mods because it's so useful so warnings may flood ck3-tiger's output on the larger mods, however if it's possible to turn the warning off using the config files then it shouldn't be a problem and may well come in handy where it is unintentionally set.
Also are you going to be considering the trigger_if ladder when doing the if ladder?
Activity
[-]Don't vieit if/else blocks that have unreachable limits[/-][+]Don't visit if/else blocks that have unreachable limits[/+]Karnor commentedon Sep 3, 2025
Interesting question about
always = yes/no.There are tons of instances of this trigger in vanilla and usually similar ratio in mods because it's so useful so warnings may flood ck3-tiger's output on the larger mods, however if it's possible to turn the warning off using the config files then it shouldn't be a problem and may well come in handy where it is unintentionally set.
Also are you going to be considering the
trigger_ifladder when doing theifladder?amtep commentedon Sep 3, 2025
Yeah I wouldn't warn about
always = yes/noby itself in a trigger, just if it's used to control an if or similar.And yeah, trigger_if can use the same logic