Ardem
January 13th, 2017, 00:14
I came across a strange issue and I am 99% sure this worked initially when I created the code but has not after the last few updates, I do not know if this is an expect failure or a bug.
The code I had originally was
if realm.getValue() == "Essence" or "Essense" then
return -70;
else
return 0;
end
However regardless of what the value is in realm.getValue() it will always pass -70, which is incorrect if the realm value is "Mentalism" however the work around is the long way which i hate, as I feel the dirty with extra code writing.
if realm.getValue() == "Essence" then
return -70;
elseif realm.getValue() == "Essense" then
return -70;
else
return 0;
Now this works because when the realm value is "Mentalism" it returns 0, now this code sit in the window script code section not a lua file not sure if that makes a difference.
Admittedly also this is very much cutdown code just to get my point across.
The code I had originally was
if realm.getValue() == "Essence" or "Essense" then
return -70;
else
return 0;
end
However regardless of what the value is in realm.getValue() it will always pass -70, which is incorrect if the realm value is "Mentalism" however the work around is the long way which i hate, as I feel the dirty with extra code writing.
if realm.getValue() == "Essence" then
return -70;
elseif realm.getValue() == "Essense" then
return -70;
else
return 0;
Now this works because when the realm value is "Mentalism" it returns 0, now this code sit in the window script code section not a lua file not sure if that makes a difference.
Admittedly also this is very much cutdown code just to get my point across.