mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 01:34:01 +00:00
[MIRROR] PKP Mind Virus: Glorfing Cigs edition [MDB IGNORE] (#16995)
* PKP Mind Virus: Glorfing Cigs edition * conflicts Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
This commit is contained in:
@@ -661,6 +661,32 @@ SUBSYSTEM_DEF(timer)
|
||||
return null
|
||||
return timer.timeToRun - (timer.flags & TIMER_CLIENT_TIME ? REALTIMEOFDAY : world.time)
|
||||
|
||||
/**
|
||||
* Update the delay on an existing LOOPING timer
|
||||
* Will come into effect on the next process
|
||||
*
|
||||
* Arguments:
|
||||
* * id a timerid or a /datum/timedevent
|
||||
* * new_wait the new wait to give this looping timer
|
||||
*/
|
||||
/proc/updatetimedelay(id, new_wait, datum/controller/subsystem/timer/timer_subsystem)
|
||||
if (!id)
|
||||
return
|
||||
if (id == TIMER_ID_NULL)
|
||||
CRASH("Tried to update the wait of null timerid. Use TIMER_STOPPABLE flag")
|
||||
if (istype(id, /datum/timedevent))
|
||||
var/datum/timedevent/timer = id
|
||||
timer.wait = new_wait
|
||||
return
|
||||
timer_subsystem = timer_subsystem || SStimer
|
||||
//id is string
|
||||
var/datum/timedevent/timer = timer_subsystem.timer_id_dict[id]
|
||||
if(!timer || timer.spent)
|
||||
return
|
||||
if(!(timer.flags & TIMER_LOOP))
|
||||
CRASH("Tried to update the wait of a non looping timer. This is not supported")
|
||||
timer.wait = new_wait
|
||||
|
||||
#undef BUCKET_LEN
|
||||
#undef BUCKET_POS
|
||||
#undef TIMER_MAX
|
||||
|
||||
Reference in New Issue
Block a user