diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index b393fd307e4..a9df1514c78 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -108,21 +108,22 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f return 1 -/obj/structure/window/hitby(AM as mob|obj) - ..() - var/tforce = 0 - if(isobj(AM)) - var/obj/item/I = AM - tforce = I.throwforce - if(reinf) tforce *= 0.25 - playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1) - health = max(0, health - tforce) - if(health <= 7 && !reinf) - anchored = 0 - update_nearby_icons() - step(src, get_dir(AM, src)) - if(health <= 0) - destroy() +/obj/structure/window/hitby(atom/movable/AM) + if(!CanPass(AM, get_step(src, AM.dir))) //So thrown objects that cross a tile with non-full windows will no longer hit the window even if it isn't visually obstructing the path. + ..() + var/tforce = 0 + if(isobj(AM)) + var/obj/item/I = AM + tforce = I.throwforce + if(reinf) tforce *= 0.25 + playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1) + health = max(0, health - tforce) + if(health <= 7 && !reinf) + anchored = 0 + update_nearby_icons() + step(src, get_dir(AM, src)) + if(health <= 0) + destroy() /obj/structure/window/attack_hand(mob/user as mob)