From 12ef284e68f4a2ac539ca0b63c03ee63562df422 Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Thu, 12 Oct 2017 23:45:51 +0300 Subject: [PATCH] Fixes foam darts on cardboard cutouts and shooting range targets (#31579) --- code/game/objects/items/cardboard_cutouts.dm | 2 ++ code/game/objects/items/shooting_range.dm | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index 6e911199c2..7f58bda189 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -67,6 +67,8 @@ push_over() /obj/item/cardboard_cutout/bullet_act(obj/item/projectile/P) + if(istype(P, /obj/item/projectile/bullet/reusable)) + P.on_hit(src, 0) visible_message("[src] has been hit by [P]!") playsound(src, 'sound/weapons/slice.ogg', 50, 1) if(prob(P.damage)) diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index c8249024f8..6803d6bb7b 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -65,10 +65,12 @@ playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1) /obj/item/target/bullet_act(obj/item/projectile/P) + if(istype(P, /obj/item/projectile/bullet/reusable)) // If it's a foam dart, don't bother with any of this other shit + return P.on_hit(src, 0) var/p_x = P.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset P.p_x!" var/p_y = P.p_y + pick(0,0,0,0,0,-1,1) var/decaltype = DECALTYPE_SCORCH - if(istype(/obj/item/projectile/bullet, P)) + if(istype(P, /obj/item/projectile/bullet)) decaltype = DECALTYPE_BULLET var/icon/C = icon(icon,icon_state) if(C.GetPixel(p_x, p_y) && P.original == src && overlays.len <= 35) // if the located pixel isn't blank (null) @@ -92,4 +94,4 @@ return -1 #undef DECALTYPE_SCORCH -#undef DECALTYPE_BULLET \ No newline at end of file +#undef DECALTYPE_BULLET