When checking if the direction keys are pressed,
PHP Code:
temp.sum = 0;
for (temp.i: {0,1,2,3})
temp.sum += keydown(temp.i);
echo(temp.sum);
is always less than or equal to 2. I can understand doing this as an optimization, but can it at least choose to report the keys that do not also have the reverse direction pressed?
e: Nevermind the above. Thanks, Jazz.
Additionally,
PHP Code:
echo(float("0.0"))
prints -1.
e: Another bug just recently discovered.
sleep-like functions are messing up the callstack. The specifics are:
- the parent caller is a public function
- the call is to a public function of another object (I've tried both weapon and TStaticVar)
- the public function contains a sleep-like function. Before the sleep, the callstack correctly contains an entry for the caller, afterwards, it does not
- script hangs indefinitely
In as terse a script as possible:
PHP Code:
//#CLIENTSIDE
function onCreated() {
temp.b = new TStaticVar();
temp.b.a = function () { return this.c.a("f"); };
temp.b.c = new TStaticVar();
temp.b.c.a = function (b) { sleep(1); return "a" @ b; };
player.chat = temp.b.a();
/* the below never gets executed */
player.chat = "?";
}