diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 02581d96f8d..367d1c62648 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -71,42 +71,32 @@ return FALSE var/blocking_object = density_check() if(blocking_object) - to_chat(user, "You cannot climb [src], as it is blocked by \a [blocking_object]!") + to_chat(user, "You cannot climb onto [src], as it is blocked by \a [blocking_object]!") return FALSE - var/turf/T = src.loc - if(!T || !istype(T)) return FALSE + if(!isturf(loc)) + return FALSE - climber = user - if(HAS_TRAIT(climber, TRAIT_TABLE_LEAP)) + if(HAS_TRAIT(user, TRAIT_TABLE_LEAP)) user.visible_message("[user] gets ready to vault up onto [src]!") if(!do_after(user, 0.5 SECONDS, target = src)) - climber = null return FALSE else user.visible_message("[user] starts climbing onto [src]!") if(!do_after(user, 5 SECONDS, target = src)) - climber = null return FALSE if(!can_touch(user) || !climbable) - climber = null return FALSE - var/old_loc = usr.loc - user.loc = get_turf(src) - user.Moved(old_loc, get_dir(old_loc, usr.loc), FALSE) + user.forceMove(get_turf(src)) if(get_turf(user) == get_turf(src)) - if(HAS_TRAIT(climber, TRAIT_TABLE_LEAP)) + if(HAS_TRAIT(user, TRAIT_TABLE_LEAP)) user.visible_message("[user] leaps up onto [src]!") else user.visible_message("[user] climbs onto [src]!") - climber = null - return TRUE - /obj/structure/proc/structure_shaken() - for(var/mob/living/M in get_turf(src)) if(IS_HORIZONTAL(M)) @@ -148,22 +138,21 @@ H.adjustBruteLoss(damage) H.UpdateDamageIcon() - return /obj/structure/proc/can_touch(mob/living/user) if(!istype(user)) - return 0 + return FALSE if(!Adjacent(user)) - return 0 + return FALSE if(user.restrained() || user.buckled) to_chat(user, "You need your hands and legs free for this.") - return 0 + return FALSE if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) - return 0 + return FALSE if(issilicon(user)) to_chat(user, "You need hands for this.") - return 0 - return 1 + return FALSE + return TRUE /obj/structure/examine(mob/user) . = ..()