Quote:
Originally Posted by Stefan
The thing is that waitfor() is working fine, ...
|
I actually uncovered this
because waitfor exhibits this behavior.
e: The call stack is only severed at the call from script A to script B. The call stack is intact for any function calls within B.
What I have looks like this:
A
PHP Code:
//#CLIENTSIDE
function onCreated() {
thing = new TStaticVar();
thing.set = function () {
if (B.ask("Are you sure?")) {
fool_the_DCO = 1;
}
echo("foo"); // never called
};
}
function onKeyPres$ed() {
thing.set();
}
$ inserted to get around the silly security.
B
PHP Code:
//#CLIENTSIDE
public function ask(text) {
temp.resp = display(text,{"yes","no"});
echo(temp.resp); // echo just fine
return temp.resp; // call stack severed, never returns
}
function display() {
for (temp.i=0; temp.i<pages; temp.i++) {
// ask for player input
while (!waitfor(this.name,"onPlayerInput"));
temp.r = some_datum;
}
return temp.r; // returns just fine
}
Or on Zenkou, pfatest: 432-6, SystemAlerts.