diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index b25e58157..0866e82ad 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -6,6 +6,8 @@
var/climb_time = 20
var/climb_stun = 20
var/climbable = FALSE
+ var/rail_climbing = FALSE
+ var/passable = FALSE
var/mob/living/structureclimber
var/broken = 0 //similar to machinery's stat BROKEN
@@ -58,14 +60,30 @@
/obj/structure/proc/do_climb(atom/movable/A)
if(climbable)
- density = FALSE
- . = step(A,get_dir(A,src.loc))
- density = TRUE
+ if(rail_climbing == FALSE)
+ density = FALSE
+ . = step(A,get_dir(A,src.loc))
+ density = TRUE
+ else
+ //We're dealing with something like a railing with similar collision to glass and a false density.
+ passable = TRUE //Passable flag overrites CheckExit and CanPass procs to return true.
+
+ if(A.loc == src.loc)
+ //Step one further than just onto the object, we want to step over it to the next tile if possible.
+ . = step(A, get_dir(A, get_step(src, src.dir)))
+ else
+ . = step(A,get_dir(A,src.loc))
+ passable = FALSE
+ A.do_twist(targetangle = 45, timer = 8)
/obj/structure/proc/climb_structure(mob/living/user)
src.add_fingerprint(user)
- user.visible_message("[user] starts climbing onto [src].", \
+ if(rail_climbing == FALSE)
+ user.visible_message("[user] starts climbing onto [src].", \
"You start climbing onto [src]...")
+ else
+ user.visible_message("[user] starts climbing over [src].", \
+ "You start climbing over [src]...")
var/adjusted_climb_time = climb_time
if(user.restrained()) //climbing takes twice as long when restrained.
adjusted_climb_time *= 2
@@ -77,14 +95,22 @@
if(do_mob(user, user, adjusted_climb_time))
if(src.loc) //Checking if structure has been destroyed
if(do_climb(user))
- user.visible_message("[user] climbs onto [src].", \
- "You climb onto [src].")
- log_combat(user, src, "climbed onto")
+ if(rail_climbing == FALSE)
+ user.visible_message("[user] climbs onto [src].", \
+ "You climb onto [src].")
+ log_combat(user, src, "climbed onto")
+ else
+ user.visible_message("[user] climbs over [src].", \
+ "You climb over [src].")
+ log_combat(user, src, "climbed over")
if(climb_stun)
user.Stun(climb_stun)
. = 1
else
- to_chat(user, "You fail to climb onto [src].")
+ if(rail_climbing == FALSE)
+ to_chat(user, "You fail to climb onto [src].")
+ else
+ to_chat(user, "You fail to climb over [src].")
structureclimber = null
/obj/structure/examine(mob/user)
diff --git a/hyperstation/code/game/objects/structures/railings.dm b/hyperstation/code/game/objects/structures/railings.dm
index 0fde72934..76b6fbb24 100644
--- a/hyperstation/code/game/objects/structures/railings.dm
+++ b/hyperstation/code/game/objects/structures/railings.dm
@@ -10,6 +10,10 @@
flags_1 = CONDUCT_1
density = FALSE
+ climbable = TRUE
+ rail_climbing = TRUE
+ climb_time = 15
+ //var/passable = FALSE // Equivalent of density check for other structures like tables, has to be different due to different collision
layer = 4
anchored = TRUE
flags_1 = ON_BORDER_1
@@ -65,6 +69,9 @@
if(istype(mover) && (mover.pass_flags & PASSGLASS) || is_type_in_typecache(mover, freepass))
return 1
+ if(passable)
+ return 1
+
if(get_dir(loc, target) != dir)
return 1
@@ -203,7 +210,6 @@
if(RCD_DECONSTRUCT)
to_chat(user, "You deconstruct the [src].")
qdel(src)
- NeighborsCheck()
return TRUE
return FALSE
@@ -307,32 +313,6 @@
return FALSE
return FALSE
-/obj/structure/railing/MouseDrop_T(mob/living/M, mob/living/user)
- if(!istype(user))
- return
- if(!isliving(user))
- return
-
- //Sanity check so players can't climb over railings into occupied spaces.
- var/turf/T = get_step(src, src.dir)
- if(CanPass(user, T) == 0)
- return FALSE
-
- usr.visible_message("[user] starts climbing onto \the [src]!")
-
- if(!do_after(user, 15, src))
- return
-
- if(get_turf(user) == get_turf(src))
- usr.dir = get_dir(usr.loc, get_step(src, src.dir))//turn and face railing
- usr.forceMove(T)
- else
- usr.dir = get_dir(usr.loc, loc)//turn and face railing
- usr.forceMove(get_turf(src))
-
- usr.visible_message("[user] climbed over \the [src]!")
- usr.do_twist(targetangle = 45, timer = 8)
-
/obj/structure/railing/proc/can_be_rotated(mob/user,rotation_type)
if(anchored)
to_chat(user, "[src] cannot be rotated while it is fastened to the floor!")