mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Ports some low level New()s to Initialize (#24211)
* Revert "Revert "Ports some low level New()s to Initialize"" * Fixes #24202 * Fixes #24197 * If ever it were to exist, it belongs here
This commit is contained in:
@@ -32,15 +32,13 @@
|
||||
//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)
|
||||
|
||||
//. = ..() //uncomment if you are dumb enough to add a /datum/New() proc
|
||||
|
||||
var/do_initialize = SSatoms.initialized
|
||||
if(do_initialize > INITIALIZATION_INSSATOMS)
|
||||
args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD
|
||||
Initialize(arglist(args))
|
||||
//. = ..() //uncomment if you are dumb enough to add a /datum/New() proc
|
||||
|
||||
//Called after New if the map is being loaded. mapload = TRUE
|
||||
//Called from base of New if the map is being loaded. mapload = FALSE
|
||||
@@ -58,6 +56,13 @@
|
||||
stack_trace("Warning: [src]([type]) initialized multiple times!")
|
||||
initialized = TRUE
|
||||
|
||||
//atom color stuff
|
||||
if(color)
|
||||
add_atom_colour(color, FIXED_COLOUR_PRIORITY)
|
||||
|
||||
if(luminosity)
|
||||
light = new(src)
|
||||
|
||||
/atom/Destroy()
|
||||
if(alternate_appearances)
|
||||
for(var/aakey in alternate_appearances)
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
/obj/machinery/doorButtons/proc/findObjsByTag()
|
||||
return
|
||||
|
||||
/obj/machinery/doorButtons/Initialize()
|
||||
/obj/machinery/doorButtons/Initialize(mapload)
|
||||
if(mapload)
|
||||
return TRUE //wait for the machines list to init
|
||||
..()
|
||||
findObjsByTag()
|
||||
|
||||
@@ -156,22 +158,22 @@
|
||||
closeDoor(A)
|
||||
|
||||
/obj/machinery/doorButtons/airlock_controller/proc/closeDoor(obj/machinery/door/airlock/A)
|
||||
set waitfor = FALSE
|
||||
if(A.density)
|
||||
goIdle()
|
||||
return 0
|
||||
update_icon()
|
||||
A.unbolt()
|
||||
spawn()
|
||||
if(A && A.close())
|
||||
if(stat & NOPOWER || lostPower || !A || QDELETED(A))
|
||||
goIdle(1)
|
||||
return
|
||||
A.bolt()
|
||||
if(busy == CLOSING)
|
||||
goIdle(1)
|
||||
else
|
||||
. = 1
|
||||
if(A && A.close())
|
||||
if(stat & NOPOWER || lostPower || !A || QDELETED(A))
|
||||
goIdle(1)
|
||||
return 1
|
||||
return
|
||||
A.bolt()
|
||||
if(busy == CLOSING)
|
||||
goIdle(1)
|
||||
else
|
||||
goIdle(1)
|
||||
|
||||
/obj/machinery/doorButtons/airlock_controller/proc/cycleClose(obj/machinery/door/airlock/A)
|
||||
if(!A || !exteriorAirlock || !interiorAirlock)
|
||||
|
||||
@@ -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)
|
||||
..()
|
||||
|
||||
@@ -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()
|
||||
..()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
..()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
volume = 1000
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/New()
|
||||
/obj/machinery/portable_atmospherics/pump/Initialize()
|
||||
..()
|
||||
pump = new(src, FALSE)
|
||||
pump.on = TRUE
|
||||
|
||||
Reference in New Issue
Block a user