Quote:
Originally Posted by Restraint
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.
|
hello!
the problem i mentioned previously involved writing to an attr rather than reading
as for the original problem i mentioned where it does involve reading an attr, usually using the concatenate method does fix it however even that fails in the latest mac client