• 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.

Timer Elapsed event

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
Does the event

call TriggerRegisterTimerEventSingle( )

create a timer or does every event use one single internal timer? If they all use the same timer, i feel DestroyTimer(GetExpiredTimer()) would cause issues
 
It uses an internal timer similar in accuracy/behavior as CreateTimer(), but you do not have access to it. Simple test:
JASS:
function X takes nothing returns nothing
    if GetExpiredTimer() == null then
        call BJDebugMsg("null")
    else
        call BJDebugMsg("not null")
    endif
endfunction

function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterTimerEvent(t, 3, false)
    call TriggerAddAction(t, function X)
endfunction
It will show "null", therefore calling DestroyTimer(GetExpiredTimer()) will have no effect (confirmed by a test I just ran).
 
Status
Not open for further replies.
Top