Window Corridor Thrown Objects Fix

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.
This commit is contained in:
KasparoVy
2017-03-31 04:43:39 -04:00
parent d20e8a54aa
commit 3aa4cefad8
+16 -15
View File
@@ -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)