Can't compare a color with a color
AKtomik opened this issue ยท 2 comments
Skript/Server Version
Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
Skript's documentation can be found here: https://docs.skriptlang.org/
Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
Server Version: git-Paper-459 (MC: 1.20.4)
Skript Version: 2.8.3 (skriptlang-github)
Installed Skript Addons: None
Installed dependencies:
- WorldGuard v7.0.9+5934e49
Bug Description
when you loop through color, you cannot directly compare the loop-value (a color) with a color.
Expected Behavior
be able to compare a color with a color.
Steps to Reproduce
in a loop of color, try to dirrectly compare the loop-value with a color.
Errors or Screenshots
Tested with this script, that show what is working and what isn't :
on load:
loop 1, 2 and 3:
if (loop-value is 1):
broadcast "this works fine"
broadcast "pretty fine" if (loop-value is 2)
loop-value is 3
broadcast "pretty pretty fine"
if blue is blue:
broadcast "this works fine too"
#the bug
loop red, blue and green:
if (loop-value is red):
broadcast "but this one not"
broadcast "and this not either" if (loop-value is blue)
loop-value is green
#avoid bug
loop red, blue and green:
set {_loop-value} to loop-value
{_loop-value} is green
broadcast "i like green"
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.
Same issue for me
command /mouton:
permission: guide
trigger:
set {_sheepCount} to 0
set {_whiteSheep} to 0
set {_blackSheep} to 0
loop all sheeps:
if "%region at loop-sheeps%" contains "mouton":
if loop-entity is a sheep:
add 1 to {_sheepCount}
if color of the loop-entity is white:
add 1 to {_whiteSheep}
if nbt of the loop-entity contains "black":
add 1 to {_blackSheep}
Oh forgot to mark this as pr available, #5601 fixes it.
That said, perhaps another pr should be made to fix it specifically.