diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm index 4e70e3b627f..e3a28fe3d47 100644 --- a/code/ZAS/Turf.dm +++ b/code/ZAS/Turf.dm @@ -1,15 +1,14 @@ /turf/simulated/var/zone/zone /turf/simulated/var/open_directions -/turf/simulated/var/gas_graphic /turf/var/needs_air_update = 0 /turf/var/datum/gas_mixture/air -/turf/simulated/proc/set_graphic(new_graphic) - gas_graphic = new_graphic - overlays.Cut() - for(var/i in gas_graphic) - overlays += i +/turf/simulated/proc/update_graphic(list/graphic_add = null, list/graphic_remove = null) + if(graphic_add) + overlays += graphic_add + if(graphic_remove) + overlays -= graphic_remove /turf/proc/update_air_properties() var/block = c_airblock(src) diff --git a/code/ZAS/Zone.dm b/code/ZAS/Zone.dm index 40c509bbd90..e794c36b02a 100644 --- a/code/ZAS/Zone.dm +++ b/code/ZAS/Zone.dm @@ -51,6 +51,9 @@ Class Procs: /zone/var/datum/gas_mixture/air = new +/zone/var/list/graphic_add = list() +/zone/var/list/graphic_remove = list() + /zone/New() air_master.add_zone(src) air.temperature = TCMB @@ -71,7 +74,7 @@ Class Procs: if(T.fire) fire_tiles.Add(T) air_master.active_fire_zones.Add(src) - T.set_graphic(air.graphic) + T.update_graphic(air.graphic) /zone/proc/remove(turf/simulated/T) #ifdef ZASDBG @@ -83,7 +86,7 @@ Class Procs: contents.Remove(T) fire_tiles.Remove(T) T.zone = null - T.set_graphic(0) + T.update_graphic(graphic_remove = air.graphic) if(contents.len) air.group_multiplier = contents.len else @@ -128,9 +131,11 @@ Class Procs: air.group_multiplier = contents.len+1 /zone/proc/tick() - if(air.check_tile_graphic()) + if(air.check_tile_graphic(graphic_add, graphic_remove)) for(var/turf/simulated/T in contents) - T.set_graphic(air.graphic) + T.update_graphic(graphic_add, graphic_remove) + graphic_add.len = 0 + graphic_remove.len = 0 /zone/proc/dbg_data(mob/M) M << name diff --git a/code/ZAS/_gas_mixture_xgm.dm b/code/ZAS/_gas_mixture_xgm.dm index dc3363d85e0..01f95ee9a58 100644 --- a/code/ZAS/_gas_mixture_xgm.dm +++ b/code/ZAS/_gas_mixture_xgm.dm @@ -268,12 +268,8 @@ zburn(null) //Rechecks the gas_mixture and adjusts the graphic list if needed. -/datum/gas_mixture/proc/check_tile_graphic() - //List of new overlays that weren't valid before. - var/list/graphic_add = null - //List of overlays that need to be removed now that they're not valid. - var/list/graphic_remove = null - +//Two lists can be passed by reference if you need know specifically which graphics were added and removed. +/datum/gas_mixture/proc/check_tile_graphic(list/graphic_add = null, list/graphic_remove = null) for(var/g in gas_data.overlay_limit) if(graphic.Find(gas_data.tile_overlay[g])) //Overlay is already applied for this gas, check if it's still valid.