[Fixed] Delay ... waiting forever

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Delay ... waiting forever

Postby kn » Thu Sep 04, 2003 4:20 pm

If you pass 0 as an argument to delay(), the script will not continue:

script 1 OPEN
{
delay(3 * 35);
print(s: "First run .... ");
delay(2 * 35);
ACS_Execute(2,0,90,0,0);
scriptwait(2);
delay(2 * 35);
print(s: "second run .... delay bug .. waiting forever");
delay(2 * 35);
ACS_Execute(2,0,0,0,0); // BUG!!!!!! change it to 2,0,1,0,0 and everything is okay
scriptwait(2);
Exit_normal(0);
}

script 2 (int dtime)
{
Print(s: "you passed ",d:dtime,s:" to this script");
Delay(dtime);
Print(s: "OK");
}
User avatar
kn
Very lazy bastard
 
Joined: 30 Jul 2003
Location: NRW

Postby Cyb » Thu Sep 04, 2003 10:08 pm

why do you need a delay of 0? just leave it out :P (alternativly 1 tic is hardly a noticable delay, so using 1 is just as effective, delay(dtime + 1);
Cyb
 
Joined: 15 Jul 2003

Postby Graf Zahl » Fri Sep 05, 2003 1:50 am

Cyb wrote:why do you need a delay of 0? just leave it out :P (alternativly 1 tic is hardly a noticable delay, so using 1 is just as effective, delay(dtime + 1);



... or change it to 'if (dtime>0) delay(dtime);'


Anyway, a delay of length 0 should not wait. As it is the 0 gets decremented without being checked and the script will wait a very long time (almost 4 years) until it continues...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Postby Hirogen2 » Fri Sep 05, 2003 5:32 am

Graf Zahl wrote:Anyway, a delay of length 0 should not wait. As it is the 0 gets decremented without being checked and the script will wait a very long time (almost 4 years) until it continues...

Sounds like a "unsigned long dt" in the ZDoom code, which hehfully decrements from 2^32 -1.
User avatar
Hirogen2
 
Joined: 19 Jul 2003
Location: Central Germany
Github ID: jengelh
Operating System: RedHat-like Linux (RHEL, Fedora, CentOS, etc) 64-bit
Graphics Processor: Intel (Modern GZDoom)

Postby kn » Fri Sep 05, 2003 7:17 am

Cyb wrote:why do you need a delay of 0? just leave it out :P (alternativly 1 tic is hardly a noticable delay, so using 1 is just as effective, delay(dtime + 1);


I don't need it. But ... I assigned ACS_Execute() to a "player enters sector" thing and I forgot to change the value.

I just noticed that this script didn't finish. I expected a delay(0) to immediately skip to the next command instead of waiting till the end of days.
User avatar
kn
Very lazy bastard
 
Joined: 30 Jul 2003
Location: NRW

Postby kn » Fri Sep 05, 2003 7:20 am

Anyway, a delay of length 0 should not wait. As it is the 0 gets decremented without being checked and the script will wait a very long time (almost 4 years) until it continues...


Hey. that's great.

Hmm.. this script doens't continue .. I'll be back in 4 years. :lol: [/quote]
User avatar
kn
Very lazy bastard
 
Joined: 30 Jul 2003
Location: NRW

Postby randi » Sat Sep 06, 2003 4:42 pm

Fixed for 2.0.48/2.1.0.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest