mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-26 14:46:52 +01:00
Makes every single shot not create ~40 timers but one
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
/proc/generate_tracer_between_points(datum/point/starting, datum/point/ending, beam_type, color, qdel_in = 5, light_range = 2, light_color_override, light_intensity = 1, instance_key) //Do not pass z-crossing points as that will not be properly (and likely will never be properly until it's absolutely needed) supported!
|
||||
/datum/beam_components_cache
|
||||
var/list/beam_components = list()
|
||||
|
||||
/datum/beam_components_cache/Destroy()
|
||||
for(var/component in beam_components)
|
||||
qdel(component)
|
||||
return ..()
|
||||
|
||||
/proc/generate_tracer_between_points(datum/point/starting, datum/point/ending, datum/beam_components_cache/beam_components, beam_type, color, qdel_in = 5, light_range = 2, light_color_override, light_intensity = 1, instance_key) //Do not pass z-crossing points as that will not be properly (and likely will never be properly until it's absolutely needed) supported!
|
||||
if(!istype(starting) || !istype(ending) || !ispath(beam_type))
|
||||
return
|
||||
var/datum/point/midpoint = point_midpoint_points(starting, ending)
|
||||
@@ -21,10 +29,9 @@
|
||||
for(var/obj/effect/projectile_lighting/PL in T)
|
||||
if(PL.owner == instance_key)
|
||||
continue tracing_line
|
||||
QDEL_IN(new /obj/effect/projectile_lighting(T, light_color_override, light_range, light_intensity, instance_key), qdel_in > 0? qdel_in : 5)
|
||||
beam_components.beam_components += new /obj/effect/projectile_lighting(T, light_color_override, light_range, light_intensity, instance_key)
|
||||
line = null
|
||||
if(qdel_in)
|
||||
QDEL_IN(PB, qdel_in)
|
||||
beam_components.beam_components += PB
|
||||
|
||||
/obj/effect/projectile/tracer
|
||||
name = "beam"
|
||||
|
||||
Reference in New Issue
Block a user