• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Wait for Condition

Status
Not open for further replies.
Level 23
Joined
Apr 16, 2012
Messages
4,041
wait for condition is just simple code that calls wait every so often and checks if the conditions has been met yet(in Jass, its something like:
JASS:
loop
    if SomeFunction(some arguments) then
        exitwhen true
    endif
    call TriggerSleepAction(0.3) //or some other value, I dont know 
endloop
)
 
Hmm, let's forget about the real accuracy when it comes to timers. It's negligible. However, the wait inaccuracy is not (for waits shorter than a second).

Wait doesn't take lags into account. If a drop player dialog appears, waits still count down, that's why lags might heavily mess up spells with waits inside.

Polled Wait is better in this regard, as it uses a timer internally to increase the wait length for an amount of game time. But Polled Wait suffers the same inaccuracy as ordinary waits and leaks a handle ID (note: not a handle, just an ID).
 
Hmm, let's forget about the real accuracy when it comes to timers. It's negligible. However, the wait inaccuracy is not (for waits shorter than a second).

Wait doesn't take lags into account. If a drop player dialog appears, waits still count down, that's why lags might heavily mess up spells with waits inside.

Polled Wait is better in this regard, as it uses a timer internally to increase the wait length for an amount of game time. But Polled Wait suffers the same inaccuracy as ordinary waits and leaks a handle ID (note: not a handle, just an ID).

I linked the wait inaccuracy thing that ap0calypse had made.
Main reason i posted. Is a handle id leak only happens when the handle is destroyed but the handle id doesnt get recycled into the id pool i guess to call it ?
 
Status
Not open for further replies.
Top