Files
Bubberstation/code/modules/projectiles/projectile/reusable/_reusable.dm
Ryll Ryll 1f1bddfe4f Foam darts and other unembeddable bullets will no longer leave ghost shrapnel (#54994)
Projectiles are assigned the ability to try embedding by the presence of a shrapnel_type variable being set on them, whether or not they actually have a set of embedding stats in their embedding var. By default, children of /obj/projectile/bullet have a shrapnel type set to a generic embedded bullet item, including things like foam darts and lollypop projectiles which shouldn't be able to embed (and certainly not embed as a bullet). While they had their embedding vars set to null, they still had their shrapnel_type set to the embedded bullet type, meaning shooting a person with a dart gun or whatever would leave a failed shrapnel item on the ground where they weren't supposed to.

This fixes that by requiring both a defined shrapnel_type AND a defined embedding var for the embedding stats. Any projectiles without both won't be able to try embedding. I also manually put 'shrapnel_type = null' on any bullet subtypes with embedding = null just to be safe and for consistency.
2020-11-23 19:35:04 -08:00

23 lines
527 B
Plaintext

/obj/projectile/bullet/reusable
name = "reusable bullet"
desc = "How do you even reuse a bullet?"
impact_effect_type = null
embedding = null
shrapnel_type = null
var/ammo_type = /obj/item/ammo_casing/caseless
var/dropped = FALSE
/obj/projectile/bullet/reusable/on_hit(atom/target, blocked = FALSE)
. = ..()
handle_drop()
/obj/projectile/bullet/reusable/on_range()
handle_drop()
..()
/obj/projectile/bullet/reusable/proc/handle_drop()
if(!dropped)
var/turf/T = get_turf(src)
new ammo_type(T)
dropped = TRUE