From 2380faf3ed5b1e1db57cc2ad01d51d1925eebe90 Mon Sep 17 00:00:00 2001
From: GDN <96800819+GDNgit@users.noreply.github.com>
Date: Wed, 6 Dec 2023 09:26:08 -0600
Subject: [PATCH] fixes a table climbing runtime (#23017)
* fixes a table climbing runtime
* should be fine
* oh yeah this too
---
code/game/objects/structures.dm | 35 +++++++++++----------------------
1 file changed, 12 insertions(+), 23 deletions(-)
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)
. = ..()