-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Allow boolean operators for all Variant types #74741
Conversation
To make consistent with previous behavior. Mostly to be used in conditions for `if` and `while`.
So... what's the status on this PR? I was hoping to continue porting my game to 4.x when 4.1 released (got halfway through before finding out about #44688 the hard way...), but at the rate it's going, I'm starting to worry it might not get into 4.1 in the first place. 😟 |
That hardly seems like a game breaking bug? You can simply be explicit about casting to booleans. Edit: I just re-read that it's about porting a 3.x game, so if you have hundreds of occurrences I understand it can be a hassle. |
Yeah, I was just about to point that out. 😂 Mind you, given what I was doing with that particular bit of syntax, the simplicity is itself pretty valuable. Makes the code more legible when you have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me for a merge in 4.1
Thanks @vnen for the PR and the extensive unit tests.
Thanks! |
OP_NOT
for all types in Variant.and
andor
in GDScript. Those have short-circuit semantics and do not rely on Variant operators.Fix #44688