mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Revise radiation view to use a cached datum
* Creates a new datum, radiation_cache, to store radiation levels per-tile * Reworks radiation subsystem to initialize, expose radiation cache * Makes radiation view reference tiles in range against rad cache
This commit is contained in:
+5
-13
@@ -1467,20 +1467,12 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
* Show an overlay of radiation levels on radioactive objects.
|
||||
*/
|
||||
/mob/proc/show_rads(range)
|
||||
var/list/rad_places = list()
|
||||
for(var/datum/component/radioactive/thing in SSradiation.processing)
|
||||
var/atom/owner = thing.parent
|
||||
var/turf/place = get_turf(owner)
|
||||
if(rad_places[place])
|
||||
rad_places[place] += thing.strength
|
||||
else
|
||||
rad_places[place] = thing.strength
|
||||
|
||||
for(var/i in rad_places)
|
||||
var/turf/place = i
|
||||
if(get_dist(src, place) >= range)
|
||||
for(var/turf/place in range(range, src))
|
||||
var/rads = SSradiation.get_turf_radiation(place)
|
||||
if (rads < RAD_BACKGROUND_RADIATION)
|
||||
continue
|
||||
var/strength = round(rad_places[i] / 1000, 0.1)
|
||||
|
||||
var/strength = round(rads / 1000, 0.1)
|
||||
var/image/pic = image(loc = place)
|
||||
var/mutable_appearance/MA = new()
|
||||
MA.maptext = MAPTEXT("[strength]k")
|
||||
|
||||
Reference in New Issue
Block a user