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.
This commit is contained in:
Leshana
2017-03-19 16:52:08 -04:00
parent 24b50fe2e6
commit ef52ccbe4d
+11 -2
View File
@@ -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