Fixes atoms being initialized twice with templates (#23746)

This commit is contained in:
Cyberboss
2017-02-07 09:35:20 -05:00
committed by AnturK
parent 1ad948373d
commit e335b2ce43

View File

@@ -29,10 +29,14 @@ var/datum/subsystem/objects/SSobj
return
initialized = INITIALIZATION_INNEW_MAPLOAD
if(objects)
for(var/thing in objects)
var/atom/A = thing
A.Initialize(TRUE)
CHECK_TICK
for(var/I in objects)
var/atom/A = I
if(!A.initialized) //this check is to make sure we don't call it twice on an object that was created in a previous Initialize call
var/start_tick = world.time
A.Initialize(TRUE)
if(start_tick != world.time)
WARNING("[A]: [A.type] slept during it's Initialize!")
CHECK_TICK
else
for(var/atom/A in world)
if(!A.initialized) //this check is to make sure we don't call it twice on an object that was created in a previous Initialize call