From 141d8487ca8410c4d33a7e29f5ce04c78c173794 Mon Sep 17 00:00:00 2001 From: tigercat2000 Date: Wed, 30 May 2018 13:34:51 -0700 Subject: [PATCH] Fix atom Initializations not inheriting /New arguments --- code/game/atoms.dm | 7 ++----- code/game/atoms_movable.dm | 17 +++++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 136c8950028..50205d3c579 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -47,12 +47,9 @@ /atom/New(loc, ...) if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() _preloader.load(src) - . = ..() - attempt_init(...) -// This is distinct from /tg/ because of our space management system -// This is overriden in /atom/movable and the parent isn't called if the SMS wants to deal with it's init -/atom/proc/attempt_init(loc, ...) + . = ..() + var/do_initialize = SSatoms.initialized if(do_initialize != INITIALIZATION_INSSATOMS) args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 7ab561f0814..30f52e8e952 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -24,19 +24,24 @@ var/area/areaMaster -/atom/movable/New() - . = ..() - areaMaster = get_area_master(src) +// This needs to not call parent until the space_manager is either dead or integrated properly with SSmapping +/atom/movable/New(loc, ...) + if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() + _preloader.load(src) -/atom/movable/attempt_init() + areaMaster = get_area_master(src) if(ticker && ticker.current_state >= GAME_STATE_SETTING_UP) var/turf/T = get_turf(src) if(T && space_manager.is_zlevel_dirty(T.z)) space_manager.postpone_init(T.z, src) return - . = ..() - + var/do_initialize = SSatoms.initialized + if(do_initialize != INITIALIZATION_INSSATOMS) + args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD + if(SSatoms.InitAtom(src, args)) + // we were deleted + return /atom/movable/Destroy() if(loc)