Makes medibeams more resilient to lag (#69919)

This commit is contained in:
ShizCalev
2022-09-17 20:32:23 -07:00
committed by GitHub
parent 9c3abb43a0
commit 310d880ceb
2 changed files with 12 additions and 2 deletions
+5 -2
View File
@@ -118,8 +118,7 @@
for(N in 0 to length-1 step 32)//-1 as we want < not <=, but we want the speed of X in Y to Z and step X
if(QDELETED(src))
break
var/obj/effect/ebeam/segment = new beam_type(origin_turf)
segment.owner = src
var/obj/effect/ebeam/segment = new beam_type(origin_turf, src)
elements += segment
//Assign our single visual ebeam to each ebeam's vis_contents
@@ -165,6 +164,10 @@
anchored = TRUE
var/datum/beam/owner
/obj/effect/ebeam/Initialize(mapload, beam_owner)
owner = beam_owner
return ..()
/obj/effect/ebeam/update_overlays()
. = ..()
var/mutable_appearance/emmisive = emissive_appearance(icon, icon_state)
@@ -123,6 +123,13 @@
qdel(dummy)
return FALSE
for(var/obj/effect/ebeam/medical/B in next_step)// Don't cross the str-beams!
if(QDELETED(current_beam))
break //We shouldn't be processing anymore.
if(QDELETED(B))
continue
if(!B.owner)
stack_trace("beam without an owner! [B]")
continue
if(B.owner.origin != current_beam.origin)
explosion(B.loc, heavy_impact_range = 3, light_impact_range = 5, flash_range = 8, explosion_cause = src)
qdel(dummy)