Skip to content
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

<condition> AND <condition> ?? #4232

Closed
1 task done
vhone opened this issue Jul 29, 2021 · 6 comments
Closed
1 task done

<condition> AND <condition> ?? #4232

vhone opened this issue Jul 29, 2021 · 6 comments

Comments

@vhone
Copy link

vhone commented Jul 29, 2021

Skript/Server Version

[17:11:52 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[17:11:52 INFO]: [Skript] Skript's documentation can be found here: https://skriptlang.github.io/Skript
[17:11:52 INFO]: [Skript] Server Version: git-Paper-133 (MC: 1.17.1)
[17:11:52 INFO]: [Skript] Skript Version: 2.6-beta2
[17:11:52 INFO]: [Skript] Installed Skript Addons:

Bug Description

on right click:
	if {_value1} is not set:
		{_value3} is set
		send "{_value1} is not set"

	else if {_value2} is not set:
		send "{_value2} is not set"

There is a problem that the condition inside the if ~ else statement is also judged.

Expected Behavior

If it was version 2.5.3, no message would have been printed.

this code prints "{_value2} is not set".
{_value1} is not set and {_value3} is set operate as AND.

Steps to Reproduce

on right click:
	if {_value1} is not set:
		{_value3} is set
		send "{_value1} is not set"

	else if {_value2} is not set:
		send "{_value2} is not set"

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and confirm I am following them with this report.
@BaeFell
Copy link
Member

BaeFell commented Jul 29, 2021

I assume the inline if statement is causing the issue. Just change it to a normal if statement?

@vhone
Copy link
Author

vhone commented Jul 29, 2021

on right click:
	if {_value1} is not set:
		if {_value3} is set:
			send "{_value1} is not set"

	else if {_value2} is not set:
		send "{_value2} is not set"

If I change it to normal if statement, no problem occurs.

on right click:
	if {_value1} is not set:
		{_value3} is not set
		send "{_value1} is not set"

	else if {_value2} is not set:
		send "{_value2} is not set"

In this case, both messages are printed.

@iOshawott
Copy link

iOshawott commented Jul 29, 2021

Did you try nightly build? I think there's already pull request (#4175) that is fixing this problem, because I cannot reproduce it on my version of skript

@vhone
Copy link
Author

vhone commented Jul 30, 2021

Did you try nightly build? I think there's already pull request (#4175) that is fixing this problem, because I cannot reproduce it on my version of skript

Uh... I don't know how to build java source. If this issue has already been fixed, I will wait for the next update. thanks.

@iOshawott
Copy link

iOshawott commented Jul 30, 2021

Did you try nightly build? I think there's already pull request (#4175) that is fixing this problem, because I cannot reproduce it on my version of skript

Uh... I don't know how to build java source. If this issue has already been fixed, I will wait for the next update. thanks.

You don't need to build it yourself! Go to actions https://github.com/SkriptLang/Skript/actions and download latest master build. (It will be it: https://github.com/SkriptLang/Skript/actions/runs/1062687996) But remember it's not official version so bugs can appear (but for me it's way more stable than beta2 in this moment) [Just need to unpack skript-nightly]

@vhone
Copy link
Author

vhone commented Jul 30, 2021

You don't need to build it yourself! Go to actions https://github.com/SkriptLang/Skript/actions and download latest maste

Thank you for answer. I tested the code with skript-nightly. And no problems were found. It's already been fixed. thank you.

@vhone vhone closed this as completed Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants