Fixed tabling through solid objects.

This commit is contained in:
alex-gh
2018-10-30 12:36:30 +01:00
parent 94ed25eba8
commit 9b6f1248c6
2 changed files with 20 additions and 21 deletions
+12 -17
View File
@@ -64,26 +64,26 @@
if(C == user)
do_climb(user)
/obj/structure/proc/density_check()
for(var/obj/O in orange(0, src))
if(O.density && !istype(O, /obj/machinery/door/window)) //Ignores windoors, as those already block climbing, otherwise a windoor on the opposite side of a table would prevent climbing.
return O
var/turf/T = get_turf(src)
if(T.density)
return T
return null
/obj/structure/proc/do_climb(var/mob/living/user)
if(!can_touch(user) || !climbable)
return
var/blocking_object = density_check()
if(blocking_object)
to_chat(user, "<span class='warning'>You cannot climb [src], as it is blocked by \a [blocking_object]!</span>")
return
for(var/obj/O in range(0, src))
if(O.density == 1 && O != src && !istype(O, /obj/machinery/door/window)) //Ignores windoors, as those already block climbing, otherwise a windoor on the opposite side of a table would prevent climbing.
to_chat(user, "<span class='warning'>You cannot climb [src], as it is blocked by \a [O]!</span>")
return
for(var/turf/T in range(0, src))
if(T.density == 1)
to_chat(user, "<span class='warning'>You cannot climb [src], as it is blocked by \a [T]!</span>")
return
var/turf/T = src.loc
if(!T || !istype(T)) return
var/obj/machinery/door/poddoor/shutters/S = locate() in T.contents
if(S && S.density) return
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climber = user
if(!do_after(user, 50, target = src))
@@ -94,11 +94,6 @@
climber = null
return
S = locate() in T.contents
if(S && S.density)
climber = null
return
usr.loc = get_turf(src)
if(get_turf(user) == get_turf(src))
usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>")
+8 -4
View File
@@ -180,12 +180,16 @@
var/obj/item/grab/G = I
if(G.affecting.buckled)
to_chat(user, "<span class='warning'>[G.affecting] is buckled to [G.affecting.buckled]!</span>")
return 0
return FALSE
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return 0
return FALSE
if(!G.confirm())
return 0
return FALSE
var/blocking_object = density_check()
if(blocking_object)
to_chat(user, "<span class='warning'>You cannot do this there is \a [blocking_object] in the way!</span>")
return FALSE
G.affecting.forceMove(get_turf(src))
G.affecting.Weaken(2)
item_placed(G.affecting)
@@ -193,7 +197,7 @@
"<span class='userdanger'>[G.assailant] pushes [G.affecting] onto [src].</span>")
add_attack_logs(G.assailant, G.affecting, "Pushed onto a table")
qdel(I)
return 1
return TRUE
qdel(I)
/obj/structure/table/attackby(obj/item/I, mob/user, params)