mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
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:
committed by
oranges
parent
1407003c17
commit
068eb07473
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user