Fixed being able to throw people on table past blast doors and other such obstacles (#30567)

This commit is contained in:
DeityLink
2021-09-07 07:04:15 +02:00
committed by GitHub
parent a5a0b58304
commit dceb478cb4

View File

@@ -381,6 +381,16 @@
return
return ..()
/obj/structure/table/proc/TryToThrowOnTable(var/mob/user,var/mob/victim)
for (var/atom/A in loc)
if (A == src)
continue
if (A.density)
to_chat(user, "<span class='warning'>\The [A] prevents you from dragging \the [victim] on top of \the [src]</span>")
return FALSE
victim.forceMove(loc)
return TRUE
/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob, params)
if (!W)
return
@@ -391,7 +401,8 @@
var/mob/living/M = G.affecting
if (G.state < GRAB_AGGRESSIVE)
if(user.a_intent == I_HURT)
M.forceMove(loc)
if (!TryToThrowOnTable(user,M))
return
if (prob(15))
M.Knockdown(5)
M.Stun(5)
@@ -403,7 +414,8 @@
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return
else
M.forceMove(loc)
if (!TryToThrowOnTable(user,M))
return
M.Knockdown(5)
M.Stun(5)
visible_message("<span class='warning'>[user] puts [M] on \the [src].</span>")
@@ -658,7 +670,8 @@
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return
else
G.affecting.forceMove(loc)
if (!TryToThrowOnTable(user,G.affecting))
return
G.affecting.Knockdown(5)
G.affecting.Stun(5)
visible_message("<span class='warning'>[G.assailant] puts [G.affecting] on \the [src].</span>")