Quote:
Originally Posted by Jakov_the_Jakovasaur
just found that the bug with attr values starting with a number also applies to when doing:
PHP Code:
GuiShowImgCtrl.actor.attr[index] = "1_OtherRandomChars";
i dont know who there is that can fix it now, but it should be fixed
|
I reported this a long time ago, when I ran into this situation with an account of mine ("100Zero100") getting passed server-to-client seemingly as "100"
The problem involves datatyping.
Although Graal does not have explicit datatypes, it does have IMPLICIT datatypes, which can be grabbed or corrected by using @.
For example:
PHP Code:
temp.a = nil;
temp.b = "";
if (a == b) { // true
if (@a == @b) { // false
The former is true because null int and null string are the same when they're just "blob" datatypes. The latter is false because null int and null string are not the same when their datatype is invoked!
To fix your problem, simply put an @ before the attr.
Example:
PHP Code:
function onCreated() {
this.attr[5] = "100Zero100";
}
//#CLIENTSIDE
function onCreated() {
sleep(1);
this.chat = this.attr[5];
}
Chat sets to: 100
PHP Code:
function onCreated() {
this.attr[5] = "100Zero100";
}
//#CLIENTSIDE
function onCreated() {
sleep(1);
this.chat = @this.attr[5];
}
Chat sets to: 100Zero100
Hope that helps to shed some light and resolve these types of bugs.