Fixes non-hitscan projectiles not having muzzle fire effects. (#16902)

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2023-07-29 13:10:32 +02:00
committed by GitHub
parent bcf43faae9
commit 652aa5ecee
2 changed files with 55 additions and 0 deletions

View File

@@ -372,6 +372,7 @@
if(hitscan)
return process_hitscan()
else
generate_muzzle_flash()
if(!isprocessing)
START_PROCESSING(SSprojectiles, src)
pixel_move(1) //move it now!
@@ -616,6 +617,19 @@
STOP_PROCESSING(SSprojectiles, src)
return ..()
/obj/item/projectile/proc/generate_muzzle_flash(duration = 3)
if(duration <= 0)
return
if(!muzzle_type || silenced)
return
var/datum/point/p = trajectory
var/atom/movable/thing = new muzzle_type
p.move_atom_to_src(thing)
var/matrix/M = new
M.Turn(original_angle)
thing.transform = M
QDEL_IN(thing, duration)
/obj/item/projectile/proc/generate_hitscan_tracers(cleanup = TRUE, duration = 3)
if(!length(beam_segments))
return