Delay smoothing atoms that have not initialized yet (#38173)

This commit is contained in:
Tad Hardesty
2018-06-03 12:25:34 -07:00
committed by letterjay
parent ab7709bedd
commit 9f4f470607
2 changed files with 17 additions and 7 deletions
+16 -6
View File
@@ -6,16 +6,26 @@ SUBSYSTEM_DEF(icon_smooth)
flags = SS_TICKER
var/list/smooth_queue = list()
var/list/deferred = list()
/datum/controller/subsystem/icon_smooth/fire()
while(smooth_queue.len)
var/atom/A = smooth_queue[smooth_queue.len]
smooth_queue.len--
smooth_icon(A)
var/list/cached = smooth_queue
while(cached.len)
var/atom/A = cached[cached.len]
cached.len--
if (A.flags_1 & INITIALIZED_1)
smooth_icon(A)
else
deferred += A
if (MC_TICK_CHECK)
return
if (!smooth_queue.len)
can_fire = 0
if (!cached.len)
if (deferred.len)
smooth_queue = deferred
deferred = cached
else
can_fire = 0
/datum/controller/subsystem/icon_smooth/Initialize()
smooth_zlevel(1,TRUE)