Fix version 2, electrification boogaloo

Fixes the ability to climb railings by removing the forcemove call that teleports players and instead refactoring the do_climb and climb_structure procedures in structure code itself.
Uses a similar method to tables of briefly turning collision off for the railing when the object is climbed in order to let players climb it, without moving the player into otherwise occupied space.
This commit is contained in:
Haha26315
2022-09-08 21:19:45 -04:00
parent f5ca97971f
commit 732f1c18f7
2 changed files with 27 additions and 7 deletions
+11
View File
@@ -84,6 +84,17 @@
else
user.visible_message("<span class='warning'>[user] starts climbing over [src].</span>", \
"<span class='notice'>You start climbing over [src]...</span>")
var/obj/structure/railing/target = src
if(target.shock(user, 100))
return
// Ensures player is in the proper place for climbing.
if(user.loc != src.loc)
if(user.loc == (get_step(src, get_dir(src.loc, user))))
step(user, get_dir(user.loc,src.loc))
var/adjusted_climb_time = climb_time
if(user.restrained()) //climbing takes twice as long when restrained.
adjusted_climb_time *= 2