[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:
SkyratBot
2022-10-20 13:22:53 +02:00
committed by GitHub
parent 7ff3848ff4
commit d7c5ab7987
27 changed files with 485 additions and 24 deletions

View File

@@ -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