Wrda
Spell Reviewer
- Joined
- Nov 18, 2012
- Messages
- 2,010
function terrainClockStartTicking takes integer tc, string onTick returns nothing
onTick doesn't really describe what kind of string one should use, perhaps "onTickFuncName" is better.
JASS:
function tcOnTickDown takes nothing returns nothing
local integer tc = tcGetTimerData(GetExpiredTimer())
if 0 != tcClockS[tc] then
set tcClockS[tc] = tcClockS[tc] - 1
call terrainClockUpdateTime(tc)
return
endif
if 0 != tcClockM[tc] then
set tcClockM[tc] = tcClockM[tc] - 1
set tcClockS[tc] = 59
call terrainClockUpdateTime(tc)
return
endif
if 0 != tcClockH[tc] then
set tcClockH[tc] = tcClockH[tc] - 1
set tcClockM[tc] = 59
set tcClockS[tc] = 59
call terrainClockUpdateTime(tc)
return
endif
set terrainClockOnExpireTc = tc
call ExecuteFunc(tcOnExpire[tc])
call TimerStart(tcTimer[tc], 0.0, false, null)
endfunction
call TimerStart(tcTimer[tc], 0.0, false, null)
Is it to "pause" the timer? Just use PauseTimer then.The timers are starting as 22:22:22 even though one of them should be counting from 00:00:00 upwards. Probably wrong animation index.
This should be reworked as JASS, or even vJASS since this code resembles that, which should be a library.
When working with timers and passing data, use TimerUtilsEx instead.
Also needs a clear API for the user and description, both in the library and in this resource.
Looks useful for a nuclear strike type of thing or boss related stuff.