mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 22:19:30 +01:00
Clean up subsystem Initialize(), require an explicit result returned, give a formal way to fail (for SSlua) (#69775)
* cleanup SS API, give SSlua a proper way to error out * New SS_INIT_ system
This commit is contained in:
@@ -102,12 +102,13 @@ SUBSYSTEM_DEF(spatial_grid)
|
||||
///how many pregenerated /mob/oranges_ear instances currently exist. this should hopefully never exceed its starting value
|
||||
var/number_of_oranges_ears = NUMBER_OF_PREGENERATED_ORANGES_EARS
|
||||
|
||||
/datum/controller/subsystem/spatial_grid/Initialize(start_timeofday)
|
||||
. = ..()
|
||||
|
||||
/datum/controller/subsystem/spatial_grid/Initialize()
|
||||
cells_on_x_axis = SPATIAL_GRID_CELLS_PER_SIDE(world.maxx)
|
||||
cells_on_y_axis = SPATIAL_GRID_CELLS_PER_SIDE(world.maxy)
|
||||
|
||||
// enter_cell only runs if 'initialized'
|
||||
initialized = TRUE
|
||||
|
||||
for(var/datum/space_level/z_level as anything in SSmapping.z_list)
|
||||
propogate_spatial_grid_to_new_z(null, z_level)
|
||||
CHECK_TICK
|
||||
@@ -126,6 +127,7 @@ SUBSYSTEM_DEF(spatial_grid)
|
||||
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_NEW_Z, .proc/propogate_spatial_grid_to_new_z)
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_EXPANDED_WORLD_BOUNDS, .proc/after_world_bounds_expanded)
|
||||
return SS_INIT_SUCCESS
|
||||
|
||||
///add a movable to the pre init queue for whichever type is specified so that when the subsystem initializes they get added to the grid
|
||||
/datum/controller/subsystem/spatial_grid/proc/enter_pre_init_queue(atom/movable/waiting_movable, type)
|
||||
|
||||
Reference in New Issue
Block a user