refactor: use signal for explosion sensors. (#26703)

This commit is contained in:
warriorstar-orion
2024-09-12 12:59:09 -04:00
committed by GitHub
parent a450ad9b9c
commit f67dbca14f
3 changed files with 19 additions and 29 deletions
+6 -6
View File
@@ -35,21 +35,21 @@
. = ..()
if(!.)
return
GLOB.doppler_arrays += src
RegisterSignal(SSdcs, COMSIG_GLOB_EXPLOSION, PROC_REF(sense_explosion))
/obj/item/mod/module/reagent_scanner/advanced/on_deactivation(display_message = TRUE, deleting = FALSE)
. = ..()
if(!.)
return
GLOB.doppler_arrays -= src
UnregisterSignal(SSdcs, COMSIG_GLOB_EXPLOSION)
/obj/item/mod/module/reagent_scanner/advanced/proc/sense_explosion(x0, y0, z0, devastation_range, heavy_impact_range,
/obj/item/mod/module/reagent_scanner/advanced/proc/sense_explosion(datum/source, turf/epicenter, devastation_range, heavy_impact_range,
light_impact_range, took, orig_dev_range, orig_heavy_range, orig_light_range)
var/turf/T = get_turf(src)
var/dx = abs(x0 - T.x)
var/dy = abs(y0 - T.y)
var/dx = abs(epicenter.x - T.x)
var/dy = abs(epicenter.y - T.y)
var/distance
if(T.z != z0)
if(T.z != epicenter.z)
return
if(dx > dy)
distance = dx