Fix cables not taking their direction from icon state (#15222)

This commit is contained in:
Wildkins
2022-12-03 14:06:25 +01:00
committed by GitHub
parent f1c812e0d2
commit e8e4c5d764
2 changed files with 14 additions and 8 deletions
+8 -8
View File
@@ -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())