Fixes freon/ice causing lag (#23493)

* Fixes freon causing lag

Yes, these were stacking. so a turf would have a bunch of "handle wet" timers running on it, every 1.5 seconds, all checking the same shit.

* Fixes unique timers
This commit is contained in:
Kyle Spier-Swenson
2017-02-02 13:28:14 -08:00
committed by oranges
parent 1407003c17
commit 068eb07473
2 changed files with 11 additions and 6 deletions
+10 -5
View File
@@ -307,12 +307,17 @@ proc/addtimer(datum/callback/callback, wait, flags)
var/datum/timedevent/hash_timer = SStimer.hashes[hash]
if(hash_timer)
if (flags & TIMER_OVERRIDE)
qdel(hash_timer)
if (hash_timer.spent) //it's pending deletion, pretend it doesn't exist.
hash_timer.hash = null
SStimer.hashes -= hash
else
if (hash_timer.flags & TIMER_STOPPABLE)
. = hash_timer.id
return
if (flags & TIMER_OVERRIDE)
qdel(hash_timer)
else
if (hash_timer.flags & TIMER_STOPPABLE)
. = hash_timer.id
return
var/timeToRun = world.time + wait