From aa82645401928ca3bd6e60ea88be80a6692348d7 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 15 Feb 2017 08:27:51 -0500 Subject: [PATCH] Ports some low level New()s to Initialize --- code/game/atoms.dm | 21 +++++++++++---------- code/game/machinery/machinery.dm | 2 +- code/game/objects/items.dm | 2 +- code/game/objects/objs.dm | 2 +- code/game/objects/structures.dm | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 57e4032b988..b3c50a9b58f 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -30,16 +30,6 @@ //atom creation method that preloads variables at creation if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() _preloader.load(src) - //atom color stuff - if(color) - add_atom_colour(color, FIXED_COLOUR_PRIORITY) - - //lighting stuff - if(opacity && isturf(loc)) - loc.UpdateAffectingLights() - - if(luminosity) - light = new(src) var/do_initialize = SSobj.initialized if(do_initialize > INITIALIZATION_INSSOBJ) @@ -61,6 +51,17 @@ stack_trace("Warning: [src]([type]) initialized multiple times!") initialized = TRUE + //atom color stuff + if(color) + add_atom_colour(color, FIXED_COLOUR_PRIORITY) + + //lighting stuff + if(opacity && isturf(loc)) + loc.UpdateAffectingLights() + + if(luminosity) + light = new(src) + /atom/Destroy() if(alternate_appearances) for(var/aakey in alternate_appearances) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 117a4e9e8e7..52d05f7671c 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -124,7 +124,7 @@ Class Procs: var/interact_offline = 0 // Can the machine be interacted with while de-powered. var/speed_process = 0 // Process as fast as possible? -/obj/machinery/New() +/obj/machinery/Initialize() if (!armor) armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70) ..() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 4a99a78723c..84ce1a6f374 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -98,7 +98,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s // non-clothing items var/datum/dog_fashion/dog_fashion = null -/obj/item/New() +/obj/item/Initialize() if (!materials) materials = list() ..() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 01fac605bd0..3492501aacf 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -28,7 +28,7 @@ var/unique_rename = 0 // can you customize the description/name of the thing? -/obj/New() +/obj/Initialize() ..() if (!armor) armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index eb6661c7dd8..d72e4e51942 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -9,7 +9,7 @@ var/mob/structureclimber var/broken = 0 //similar to machinery's stat BROKEN -/obj/structure/New() +/obj/structure/Initialize() if (!armor) armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50) ..()