Skip to content

Commit

Permalink
Revert "Fixes a decade old ZAS issue (#483)" (#516)
Browse files Browse the repository at this point in the history
This reverts commit 829d7ca.
  • Loading branch information
Kapu1178 authored Aug 29, 2023
1 parent b47bb03 commit 64b0467
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 62 deletions.
28 changes: 8 additions & 20 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,6 @@
spark_system = null
return ..()

/obj/machinery/door/zas_update_loc()
. = ..()
if(!.)
return

var/turf/T = get_turf(src)

if(density)
if(!T.zone || T.zone.invalid)
return
var/zone/old_zone = T.zone
old_zone.remove_turf(T)

var/datum/gas_mixture/GM = unsafe_return_air()
old_zone.air.merge(GM)
GM.zero()

else
T.update_air_properties()

/obj/machinery/door/zas_canpass(turf/other)
if(QDELETED(src))
return AIR_ALLOWED
Expand Down Expand Up @@ -268,6 +248,14 @@
do_animate("deny")
return

/obj/machinery/door/Move()
var/turf/T = loc
. = ..()
if(.)
T.zas_update_loc()
zas_update_loc()


/obj/machinery/door/CanAllowThrough(atom/movable/mover, border_dir)
. = ..()
if(.)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/atmospherics/ZAS/Atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

///Tells ZAS to mark the tile the atom is in to update.
/atom/proc/zas_update_loc()
if(!SSzas.initialized)
return FALSE
var/turf/T = get_turf(src)
if(T?.simulated)
SSzas.mark_for_update(T)
Expand Down
1 change: 0 additions & 1 deletion code/modules/atmospherics/ZAS/Debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ GLOBAL_REAL_VAR(list/zasdbgovl_dirzoneblock) = list(
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
layer = FLY_LAYER
vis_flags = NONE
appearance_flags = RESET_COLOR | RESET_TRANSFORM | RESET_ALPHA | KEEP_APART

/obj/effect/zasdbg/assigned
icon_state = "assigned"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/atmospherics/ZAS/Turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
*/
///Simple heuristic for determining if removing the turf from it's zone will not partition the zone (A very bad thing).
/turf/proc/can_safely_remove_from_zone()
if(isnull(zone) || zone.invalid)
if(isnull(zone))
return TRUE

var/check_dirs
Expand Down
12 changes: 2 additions & 10 deletions code/modules/atmospherics/ZAS/XGM/xgm_gas_mixture.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/gas_mixture
//Associative list of gas moles.
//Gases with 0 moles are not tracked and are pruned by updateValues()
var/list/gas
var/list/gas = list()
//Temperature in Kelvin of this gas mix.
var/temperature = 0

Expand All @@ -13,16 +13,14 @@
var/group_multiplier = 1

//List of active tile overlays for this gas_mixture. Updated by checkTileGraphic()
var/list/graphic
var/list/graphic = list()
//Cache of gas overlay objects
var/list/tile_overlay_cache

/datum/gas_mixture/New(_volume = CELL_VOLUME, _temperature = 0, _group_multiplier = 1)
volume = _volume
temperature = _temperature
group_multiplier = _group_multiplier
gas = list()
graphic = list()

///Returns the volume of a specific gas within the entire zone.
/datum/gas_mixture/proc/getGroupGas(gasid)
Expand All @@ -34,12 +32,6 @@
/datum/gas_mixture/proc/getGroupMoles()
return total_moles * group_multiplier

/datum/gas_mixture/proc/zero()
gas.Cut()
temperature = T0C
group_multiplier = 1
total_moles = 0

///Takes a gas string and the amount of moles to adjust by. Calls updateValues() if update isn't 0.
/datum/gas_mixture/proc/adjustGas(gasid, moles, update = TRUE)
if(moles == 0)
Expand Down
14 changes: 6 additions & 8 deletions code/modules/atmospherics/ZAS/Zone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Class Procs:
atmos_sensitive_contents = null
#ifdef ZASDBG
for(var/turf/T as anything in contents)
if(T.simulated)
if(!T.simulated)
T.dbg(zasdbgovl_invalid_zone)
#endif

Expand All @@ -183,15 +183,13 @@ Class Procs:
for(var/turf/T as anything in contents)
if(!T.simulated)
continue
remove_turf(T)
CHECK_TICK

for(var/turf/T as anything in contents)
if(!T.simulated)
continue

T.update_graphic(graphic_remove = air.graphic) //we need to remove the overlays so they're not doubled when the zone is rebuilt
#ifdef ZASDBG
//T.dbg(invalid_zone)
#endif
T.needs_air_update = 0 //Reset the marker so that it will be added to the list.
SSzas.mark_for_update(T)

CHECK_TICK

///Assumes a given gas mixture, dividing it amongst the zone.
Expand Down
20 changes: 0 additions & 20 deletions code/modules/atmospherics/ZAS/zas_extras/inflatable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,6 @@
return
return TryToSwitchState(user)

/obj/machinery/inflatable/door/zas_update_loc()
. = ..()
if(!.)
return

var/turf/T = get_turf(src)

if(density)
if(!T.zone || T.zone.invalid)
return
var/zone/old_zone = T.zone
old_zone.remove_turf(T)

var/datum/gas_mixture/GM = unsafe_return_air()
old_zone.air.merge(GM)
GM.zero()

else
T.update_air_properties()

/obj/structure/inflatable/door/proc/TryToSwitchState(atom/user)
if(isSwitchingStates) return
if(ismob(user))
Expand Down

0 comments on commit 64b0467

Please sign in to comment.