More New() -> Initialize() for /obj/structure (#15158)

* More New() -> Initialize() for /obj/structure

* Updates these

* Tweaks + Fixes
This commit is contained in:
AffectedArc07
2020-12-29 10:42:39 -05:00
committed by GitHub
parent 3f80ce3076
commit 43ee2488c7
41 changed files with 221 additions and 239 deletions
@@ -16,8 +16,8 @@
var/base_state
var/dpdir = 0 // directions as disposalpipe
/obj/structure/disposalconstruct/New(loc, pipe_type, direction)
..()
/obj/structure/disposalconstruct/Initialize(mapload, pipe_type, direction)
. = ..()
if(pipe_type)
ptype = pipe_type
if(dir)
+27 -26
View File
@@ -692,8 +692,8 @@
var/base_icon_state // initial icon state on map
// new pipe, set the icon_state as on map
/obj/structure/disposalpipe/New()
..()
/obj/structure/disposalpipe/Initialize(mapload)
. = ..()
base_icon_state = icon_state
@@ -753,8 +753,8 @@
// update the icon_state to reflect hidden status
/obj/structure/disposalpipe/proc/update()
var/turf/T = src.loc
hide(T.intact && !istype(T,/turf/space)) // space never hides pipes
var/turf/T = get_turf(src)
hide(T.intact && !istype(T, /turf/space)) // space never hides pipes
update_icon()
// hide called by levelupdate if turf intact status changes
@@ -934,13 +934,12 @@
/obj/structure/disposalpipe/segment
icon_state = "pipe-s"
/obj/structure/disposalpipe/segment/New()
..()
/obj/structure/disposalpipe/segment/Initialize(mapload)
. = ..()
if(icon_state == "pipe-s")
dpdir = dir | turn(dir, 180)
else
dpdir = dir | turn(dir, -90)
update()
@@ -949,8 +948,8 @@
/obj/structure/disposalpipe/junction
icon_state = "pipe-j1"
/obj/structure/disposalpipe/junction/New()
..()
/obj/structure/disposalpipe/junction/Initialize(mapload)
. = ..()
if(icon_state == "pipe-j1")
dpdir = dir | turn(dir, -90) | turn(dir,180)
else if(icon_state == "pipe-j2")
@@ -1015,8 +1014,8 @@
dpdir = sortdir | posdir | negdir
/obj/structure/disposalpipe/sortjunction/New()
..()
/obj/structure/disposalpipe/sortjunction/Initialize(mapload)
. = ..()
updatedir()
updatedesc()
update()
@@ -1082,8 +1081,8 @@
var/negdir = 0
var/sortdir = 0
/obj/structure/disposalpipe/wrapsortjunction/New()
..()
/obj/structure/disposalpipe/wrapsortjunction/Initialize(mapload)
. = ..()
posdir = dir
if(icon_state == "pipe-j1s")
sortdir = turn(posdir, -90)
@@ -1137,11 +1136,10 @@
icon_state = "pipe-t"
var/obj/linked // the linked obj/machinery/disposal or obj/disposaloutlet
/obj/structure/disposalpipe/trunk/New()
..()
/obj/structure/disposalpipe/trunk/Initialize(mapload)
. = ..()
dpdir = dir
spawn(1)
getlinked()
addtimer(CALLBACK(src, .proc/getlinked), 0) // This has a delay of 0, but wont actually start until the MC is done
update()
return
@@ -1243,8 +1241,8 @@
// i.e. will be treated as an empty turf
desc = "A broken piece of disposal pipe."
/obj/structure/disposalpipe/broken/New()
..()
/obj/structure/disposalpipe/broken/Initialize(mapload)
. = ..()
update()
return
@@ -1269,13 +1267,16 @@
var/obj/structure/disposalpipe/trunk/linkedtrunk
var/mode = 0
/obj/structure/disposaloutlet/New()
..()
spawn(1)
target = get_ranged_target_turf(src, dir, 10)
var/obj/structure/disposalpipe/trunk/T = locate() in loc
if(T)
T.nicely_link_to_other_stuff(src)
/obj/structure/disposaloutlet/Initialize(mapload)
. = ..()
addtimer(CALLBACK(src, .proc/setup), 0) // Wait of 0, but this wont actually do anything until the MC is firing
/obj/structure/disposaloutlet/proc/setup()
target = get_ranged_target_turf(src, dir, 10)
var/obj/structure/disposalpipe/trunk/T = locate() in get_turf(src)
if(T)
T.nicely_link_to_other_stuff(src)
/obj/structure/disposaloutlet/Destroy()
if(linkedtrunk)