From 4b1f394b2b71078d4e6d7a2b20fd0b2aed659d35 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Sat, 11 Aug 2012 23:53:07 -0700 Subject: [PATCH] Made a whoopsie in the ladder code, now conforms to modular Z-levels. Signed-off-by: SkyMarshal --- code/TriDimension/Structures.dm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/code/TriDimension/Structures.dm b/code/TriDimension/Structures.dm index c1aadc83525..2914f6a4ad9 100644 --- a/code/TriDimension/Structures.dm +++ b/code/TriDimension/Structures.dm @@ -24,11 +24,12 @@ . = ..() spawn(1) //Allow map to load if(!target) - target = locate() in locate(x,y,z-1) + var/list/adjacent_to_me = global_adjacent_z_levels["[z]"] + target = locate() in locate(x,y,adjacent_to_me["down"]) if (istype(target)) icon_state = top_icon_state else - target = locate() in locate(x,y,z+1) + target = locate() in locate(x,y,adjacent_to_me["up"]) if (istype(target)) icon_state = bottom_icon_state else @@ -52,7 +53,8 @@ attack_hand(var/mob/M) if(!target || !istype(target.loc, /turf)) del src - M.visible_message("\blue \The [M] climbs [target.z > z ? "up" : "down"] \the [src]!", "You climb [target.z > z ? "up" : "down"] \the [src]!", "You hear some grunting, and clanging of a metal ladder being used.") + var/list/adjacent_to_me = global_adjacent_z_levels["[z]"] + M.visible_message("\blue \The [M] climbs [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You climb [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You hear some grunting, and clanging of a metal ladder being used.") M.Move(target.loc) @@ -99,7 +101,8 @@ if(!target || !istype(target.loc, /turf)) del src if(M.z == z && get_dist(src,M) <= 1) - M.visible_message("\blue \The [M] scurries [target.z > z ? "up" : "down"] \the [src]!", "You scramble [target.z > z ? "up" : "down"] \the [src]!", "You hear some grunting, and a hatch sealing.") + var/list/adjacent_to_me = global_adjacent_z_levels["[z]"] + M.visible_message("\blue \The [M] scurries [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You scramble [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You hear some grunting, and a hatch sealing.") M.Move(target.loc) flick(top_icon_state_close,top_hatch) bottom_hatch.overlays -= green_overlay @@ -125,11 +128,12 @@ . = ..() spawn(1) if(!target) - target = locate() in locate(x,y,z+1) + var/list/adjacent_to_me = global_adjacent_z_levels["[z]"] + target = locate() in locate(x,y,adjacent_to_me["up"]) if(istype(target)) icon_state = bottom_icon_state else - target = locate() in locate(x,y,z-1) + target = locate() in locate(x,y,adjacent_to_me["down"]) if(istype(target)) icon_state = top_icon_state else