Sound update

This commit is contained in:
Selis
2023-12-12 23:31:03 +01:00
parent 552deaedf1
commit a8b43cb28c
10 changed files with 1006 additions and 613 deletions
+20
View File
@@ -512,6 +512,26 @@ SUBSYSTEM_DEF(timer)
return TRUE
return FALSE
/**
* Get the remaining deciseconds on a timer
*
* Arguments:
* * id a timerid or a /datum/timedevent
*/
/proc/timeleft(id, datum/controller/subsystem/timer/timer_subsystem)
if (!id)
return null
if (id == TIMER_ID_NULL)
CRASH("Tried to get timeleft of a null timerid. Use TIMER_STOPPABLE flag")
if (istype(id, /datum/timedevent))
var/datum/timedevent/timer = id
return timer.timeToRun - world.time
timer_subsystem = timer_subsystem || SStimer
//id is string
var/datum/timedevent/timer = timer_subsystem.timer_id_dict[id]
if(!timer || timer.spent)
return null
return timer.timeToRun - (timer.flags & TIMER_CLIENT_TIME ? REALTIMEOFDAY : world.time)
#undef BUCKET_LEN
#undef BUCKET_POS