Another question, waits

Status
Not open for further replies.
Level 8
Joined
Aug 1, 2008
Messages
420
Im helping my friend with his map, but he used game-time waits in some of his stuff. Ive heard they caused de-syncs so im helping him turn them back into normal waits. but does anybody know: How many seconds is 1 game-time second or vise versa? does anybody actually know the conversion? because this would save me alot of time.
 
Well simply watch the function for wait (game time). It still uses Triggersleepaction but an additional timer to syncronize other players.
Code:
function PolledWait takes real duration returns nothing
    local timer t
    local real  timeRemaining

    if (duration > 0) then
        set t = CreateTimer()
        call TimerStart(t, duration, false, null)
        loop
            set timeRemaining = TimerGetRemaining(t)
            exitwhen timeRemaining <= 0

            // If we have a bit of time left, skip past 10% of the remaining
            // duration instead of checking every interval, to minimize the
            // polling on long waits.
            if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
                call TriggerSleepAction(0.1 * timeRemaining)
            else
                call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
            endif
        endloop
        call DestroyTimer(t)
    endif
endfunction
 
Sorry i dont understand jass. Tried to work out what it meant but couldnt find out :S

ok, if you say game-time waits are good, ill leave those how it is, thanks.
 
Status
Not open for further replies.
Back
Top