From ef52ccbe4dcfeba7a6d21d6e5ef72251becc53ee Mon Sep 17 00:00:00 2001 From: Leshana Date: Sun, 19 Mar 2017 16:52:08 -0400 Subject: [PATCH] Fix thrown objects hitting windows not in their path * Fixes windows counting as blocking the entire tile for thrown objects when they don't. * Same thing for windoors, which have the same problem. --- code/game/atoms_movable.dm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 4c48b84532..b76620fa95 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -125,8 +125,17 @@ if(A:lying) continue src.throw_impact(A,speed) if(isobj(A)) - if(A.density && !A.throwpass) // **TODO: Better behaviour for windows which are dense, but shouldn't always stop movement - src.throw_impact(A,speed) + if(!A.density || A.throwpass) + continue + // Special handling of windows, which are dense but block only from some directions + if(istype(A, /obj/structure/window)) + var/obj/structure/window/W = A + if (!W.is_full_window() && !(turn(src.last_move, 180) & A.dir)) + continue + // Same thing for (closed) windoors, which have the same problem + else if(istype(A, /obj/machinery/door/window) && !(turn(src.last_move, 180) & A.dir)) + continue + src.throw_impact(A,speed) /atom/movable/proc/throw_at(atom/target, range, speed, thrower) if(!target || !src) return 0