Overmap sensors overhaul (#15666)

This commit is contained in:
Fluffy
2023-02-03 23:39:18 +01:00
committed by GitHub
parent 9b197fde5b
commit 14d41d1e84
23 changed files with 673 additions and 25 deletions

9
code/_helpers/overmap.dm Normal file
View File

@@ -0,0 +1,9 @@
var/datum/overmap_sectors = list()
var/datum/overmaps_by_name = list()
var/datum/overmaps_by_z = list()
/proc/get_empty_zlevel(var/base_turf_type)
if(base_turf_type && base_turf_type != world.turf)
for(var/turf/T as anything in block(locate(1, 1, .),locate(world.maxx, world.maxy, .)))
T.ChangeTurf(base_turf_type)
return world.maxz

View File

@@ -9,6 +9,10 @@
/proc/cmp_filter_data_priority(list/A, list/B)
return A["priority"] - B["priority"]
// Defining this for future proofing and ease of searching for erroneous usage.
/image/proc/add_filter(filter_name, priority, list/params)
filters += filter(arglist(params))
/atom/movable/proc/add_filter(filter_name, priority, list/params)
LAZYINITLIST(filter_data)
var/list/p = params.Copy()
@@ -46,13 +50,13 @@
var/list/monkeypatched_params = params.Copy()
monkeypatched_params.Insert(1, null)
var/index = filter_data.Find(filter_name)
// First, animate ourselves.
monkeypatched_params[1] = filters[index]
monkeypatched_params[1] = filters[index]
animate(arglist(monkeypatched_params))
// If we're being copied by Z-Mimic, update mimics too.
if (bound_overlay)
for (var/atom/movable/AM as anything in get_above_oo())
monkeypatched_params[1] = AM.filters[index]
animate(arglist(monkeypatched_params))
animate(arglist(monkeypatched_params))