From 55f8700a8c1725a1ed267f951422da47c6a14bf3 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Fri, 2 Jun 2017 23:18:07 -0500 Subject: [PATCH] Fix some camera Initializes (#1337) --- code/game/machinery/camera/presets.dm | 39 +++++++++++++-------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index bd06d4e8d3..621d96f6f6 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -5,7 +5,7 @@ start_active = 1 /obj/machinery/camera/emp_proof/Initialize() - ..() + . = ..() upgradeEmpProof() // X-RAY @@ -15,7 +15,7 @@ icon_state = "xraycam" // Thanks to Krutchen for the icons. /obj/machinery/camera/xray/Initialize() - ..() + . = ..() upgradeXRay() // MOTION @@ -32,7 +32,7 @@ start_active = 1 /obj/machinery/camera/all/Initialize() - ..() + . = ..() upgradeEmpProof() upgradeXRay() upgradeMotion() @@ -43,23 +43,22 @@ var/number = 0 //camera number in area //This camera type automatically sets it's name to whatever the area that it's in is called. -/obj/machinery/camera/autoname/Initialize(mapload) - if(mapload) - ..() - return TRUE - else - if(!initialized) - ..() - number = 1 - var/area/A = get_area(src) - if(A) - for(var/obj/machinery/camera/autoname/C in GLOB.machines) - if(C == src) continue - var/area/CA = get_area(C) - if(CA.type == A.type) - if(C.number) - number = max(number, C.number+1) - c_tag = "[A.name] #[number]" +/obj/machinery/camera/autoname/Initialize() + ..() + return INITIALIZE_HINT_LATELOAD + +/obj/machinery/camera/autoname/LateInitialize() + . = ..() + number = 1 + var/area/A = get_area(src) + if(A) + for(var/obj/machinery/camera/autoname/C in GLOB.machines) + if(C == src) continue + var/area/CA = get_area(C) + if(CA.type == A.type) + if(C.number) + number = max(number, C.number+1) + c_tag = "[A.name] #[number]" // CHECKS