diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index f0c4791e1cd..4a5c66838c0 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -66,17 +66,17 @@ By design, d1 is the smallest direction and d2 is the highest /obj/structure/cable/white color = COLOR_WHITE +// Needs to run before init or we have sad cable knots on away sites +/obj/structure/cable/New() + . = ..() + // ensure d1 & d2 reflect the icon_state for entering and exiting cable + var/dash = findtext(icon_state, "-") + d1 = text2num(copytext(icon_state, 1, dash)) + d2 = text2num(copytext(icon_state, dash + 1)) + /obj/structure/cable/Initialize(mapload) . = ..() - // ensure d1 & d2 reflect the icon_state for entering and exiting cable - - var/dash = findtext(icon_state, "-") - - d1 = text2num( copytext( icon_state, 1, dash ) ) - - d2 = text2num( copytext( icon_state, dash+1 ) ) - var/turf/T = src.loc // hide if turf is not intact if(level == 1 && !T.is_hole) hide(!T.is_plating()) diff --git a/html/changelogs/johnwildkins-powerinit.yml b/html/changelogs/johnwildkins-powerinit.yml new file mode 100644 index 00000000000..456f0e93f16 --- /dev/null +++ b/html/changelogs/johnwildkins-powerinit.yml @@ -0,0 +1,6 @@ +author: JohnWildkins + +delete-after: True + +changes: + - backend: "Cables now correctly override their direction vars to match the set icon state, making mapped-in d1/d2 vars superfluous."