mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-10 22:54:32 +01:00
refactor: use signal for explosion sensors. (#26703)
This commit is contained in:
committed by
GitHub
parent
a450ad9b9c
commit
f67dbca14f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user