mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 20:43:10 +01:00
Improve Object Initialization (#1368)
Okay. You can read the entire theory over in this issue: #1365 But basically. All objects to be initialized are now added to a list in their New() proc on world/New(). This is substantially smaller than the entire world. This allows game_controller/setup_objects() to crawl a much larger list, and speeds it up by 6 seconds (from 9.5 to 3.5 seconds). The impact on world/New() is, on average, under 1 second. Also fixes #1365 and #1363 as a result of reworking the initialization call logic in atoms_movable.dm. initialize() is now more secure, and can handle recursive calls at any point in time.
This commit is contained in:
@@ -46,13 +46,18 @@ datum/controller/game_controller/proc/setup()
|
||||
datum/controller/game_controller/proc/setup_objects()
|
||||
admin_notice("<span class='danger'>Initializing objects</span>", R_DEBUG)
|
||||
sleep(-1)
|
||||
for(var/atom/movable/object in world)
|
||||
objects_initialized = 1
|
||||
for(var/A in objects_init_list)
|
||||
var/atom/movable/object = A
|
||||
if(isnull(object.gcDestroyed))
|
||||
object.initialize()
|
||||
|
||||
objects_init_list.Cut()
|
||||
|
||||
admin_notice("<span class='danger'>Initializing areas</span>", R_DEBUG)
|
||||
sleep(-1)
|
||||
for(var/area/area in all_areas)
|
||||
for(var/A in all_areas)
|
||||
var/area/area = A
|
||||
area.initialize()
|
||||
|
||||
admin_notice("<span class='danger'>Initializing pipe networks</span>", R_DEBUG)
|
||||
|
||||
Reference in New Issue
Block a user