From b70c8c636a190f6f8a2c1b4248875b31b697b58c Mon Sep 17 00:00:00 2001 From: coiax Date: Fri, 24 Mar 2017 11:47:03 +0000 Subject: [PATCH] Switches lattices to Initialize (#25396) --- code/game/objects/structures/lattice.dm | 36 ++++++++++--------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 312f6c32dcb..3138c7cbcc6 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -9,7 +9,7 @@ obj_integrity = 50 max_integrity = 50 layer = LATTICE_LAYER //under pipes - var/obj/item/stack/rods/stored + var/number_of_rods = 1 canSmoothWith = list(/obj/structure/lattice, /turf/open/floor, /turf/closed/wall, @@ -17,26 +17,20 @@ smooth = SMOOTH_MORE // flags = CONDUCT -/obj/structure/lattice/New() +/obj/structure/lattice/Initialize(mapload) ..() - for(var/obj/structure/lattice/LAT in src.loc) + for(var/obj/structure/lattice/LAT in loc) if(LAT != src) qdel(LAT) - stored = new/obj/item/stack/rods(src) - -/obj/structure/lattice/Destroy() - qdel(stored) - stored = null - return ..() /obj/structure/lattice/blob_act(obj/structure/blob/B) return /obj/structure/lattice/ratvar_act() if(IsEven(x + y)) - new/obj/structure/lattice/clockwork(loc) + new /obj/structure/lattice/clockwork(loc) else - new/obj/structure/lattice/clockwork/large(loc) + new /obj/structure/lattice/clockwork/large(loc) /obj/structure/lattice/attackby(obj/item/C, mob/user, params) if(istype(C, /obj/item/weapon/wirecutters)) @@ -48,8 +42,7 @@ /obj/structure/lattice/deconstruct(disassembled = TRUE) if(!(flags & NODECONSTRUCT)) - stored.forceMove(get_turf(src)) - stored = null + new /obj/item/stack/rods(get_turf(src), amount=number_of_rods) qdel(src) /obj/structure/lattice/singularity_pull(S, current_size) @@ -61,15 +54,15 @@ desc = "A lightweight support lattice. These hold the Justicar's station together." icon = 'icons/obj/smooth_structures/lattice_clockwork.dmi' -/obj/structure/lattice/clockwork/New() +/obj/structure/lattice/clockwork/Initialize(mapload) ..() ratvar_act() /obj/structure/lattice/clockwork/ratvar_act() if(IsOdd(x+y)) - new/obj/structure/lattice/clockwork/large(loc) + new /obj/structure/lattice/clockwork/large(loc) // deletes old one -/obj/structure/lattice/clockwork/large/New() +/obj/structure/lattice/clockwork/large/Initialize(mapload) ..() icon = 'icons/obj/smooth_structures/lattice_clockwork_large.dmi' pixel_x = -9 @@ -77,7 +70,7 @@ /obj/structure/lattice/clockwork/large/ratvar_act() if(IsEven(x + y)) - new/obj/structure/lattice/clockwork(loc) + new /obj/structure/lattice/clockwork(loc) /obj/structure/lattice/catwalk name = "catwalk" @@ -87,13 +80,12 @@ smooth = SMOOTH_TRUE canSmoothWith = null -/obj/structure/lattice/catwalk/New() +/obj/structure/lattice/catwalk/Initialize(mapload) ..() - stored.amount++ - stored.update_icon() + number_of_rods++ /obj/structure/lattice/catwalk/ratvar_act() - new/obj/structure/lattice/catwalk/clockwork(loc) + new /obj/structure/lattice/catwalk/clockwork(loc) /obj/structure/lattice/catwalk/Move() var/turf/T = loc @@ -111,7 +103,7 @@ name = "clockwork catwalk" icon = 'icons/obj/smooth_structures/catwalk_clockwork.dmi' -/obj/structure/lattice/catwalk/clockwork/New() +/obj/structure/lattice/catwalk/clockwork/Initialize(mapload) ..() new /obj/effect/overlay/temp/ratvar/floor/catwalk(loc) new /obj/effect/overlay/temp/ratvar/beam/catwalk(loc)