Quote:
Originally Posted by Jakov_the_Jakovasaur
the problem described by fowlplay4 also seems to be happening for player.attr[] values with mac users, and likewise i do not use mac so cant confirm or debug it
|
i just noticed now there that there is actually
not a bug reading such strings which begin with a number within player attributes for the new mac client, it simply appeared to be the case because during my attempts to debug a problem the real bug turned out to be that a string value was being treated as if it were NULL
example:
PHP Code:
function onCreated()
this.hash = new TStaticVar();
function something() {
//set these attributes just for the sake of an example
player.attr[5] = "1 3 0.05";
player.attr[6] = "2 4 0.1";
player.attr[7] = "0 0";
//lets just pretend that this is defined as an array
temp.save = this.hash.(@ player.account);
temp.h = player.attr[5] @ player.attr[6] @ player.attr[7];
echo(temp.h); //outputs: 1 3 0.052 4 0.10 0
/*is never true because temp.save[6] starts as NULL
and temp.h is treated as NULL when it actually isnt*/
if (temp.h != temp.save[6]) {
this.doSomethingElse(player);
temp.save[6] = temp.h;
this.hash.(@ player.account) = temp.save;
}
echo(temp.h == NULL); //outputs: 1
}
this example should show that there is a bug with concatenating strings which consist of numbers in such a way, as temp.h is being treated as if it is NULL when it is not NULL