Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSuckerberg committed Jan 12, 2024
1 parent ad4740f commit 7d7ecb2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
7 changes: 7 additions & 0 deletions code/__DEFINES/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@
#define GAS_FLAG_DANGEROUS (1<<0)
#define GAS_FLAG_BREATH_PROC (1<<1)

// Flag for update_air_ref()
#define AIR_REF_CLOSED_TURF -1
#define AIR_REF_SPACE_TURF 0

#define AIR_REF_PLANETARY_TURF (1<<0) //SIMULATION_DIFFUSE 0b1
#define AIR_REF_OPEN_TURF (1<<1) //SIMULATION_ALL 0b10

//HELPERS
#define PIPING_LAYER_SHIFT(T, PipingLayer) \
if(T.dir & (NORTH|SOUTH)) { \
Expand Down
13 changes: 5 additions & 8 deletions code/game/turfs/change_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
/turf/open/ChangeTurf(path, list/new_baseturfs, flags) //Resist the temptation to make this default to keeping air.
//don't
if(!SSair.initialized)
. = ..()
return
return ..()
if ((flags & CHANGETURF_INHERIT_AIR) && ispath(path, /turf/open) && air)
var/datum/gas_mixture/stashed_air = new()
stashed_air.copy_from(air)
Expand All @@ -178,25 +177,23 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
QDEL_NULL(stashed_air)
return
var/turf/open/newTurf = .
var/turf_fire_ref
if(turf_fire)
if(isgroundlessturf(newTurf))
QDEL_NULL(turf_fire)
else
turf_fire_ref = turf_fire
newTurf.turf_fire = turf_fire_ref
newTurf.turf_fire = turf_fire
newTurf.air.copy_from(stashed_air)
update_air_ref(planetary_atmos ? 1 : 2)
update_air_ref(planetary_atmos ? AIR_REF_PLANETARY_TURF : AIR_REF_OPEN_TURF)
QDEL_NULL(stashed_air)
else
if(turf_fire)
QDEL_NULL(turf_fire)
if(ispath(path, /turf/open))
. = ..()
if(!istype(air,/datum/gas_mixture))
if(!istype(air, /datum/gas_mixture))
Initalize_Atmos(0)
else
update_air_ref(-1)
update_air_ref(AIR_REF_CLOSED_TURF)
. = ..()


Expand Down
4 changes: 2 additions & 2 deletions code/game/turfs/open/_open.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@
/turf/open/Initalize_Atmos(times_fired)
if(!blocks_air)
if(!istype(air,/datum/gas_mixture/turf))
air = new(2500,src)
air = new(2500, src)
air.copy_from_turf(src)
update_air_ref(planetary_atmos ? 1 : 2)
update_air_ref(planetary_atmos ? AIR_REF_PLANETARY_TURF : AIR_REF_OPEN_TURF)

update_visuals()

Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/open/space/space.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
if(!space_gas)
space_gas = new
air = space_gas
update_air_ref(0)
update_air_ref(AIR_REF_SPACE_TURF)
vis_contents.Cut() //removes inherited overlays
visibilityChanged()

Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ GLOBAL_LIST_EMPTY(created_baseturf_lists)
var/turf/open/O = src
__auxtools_update_turf_temp_info(isspaceturf(get_z_base_turf()) && !O.planetary_atmos)
else
update_air_ref(-1)
update_air_ref(AIR_REF_CLOSED_TURF)
__auxtools_update_turf_temp_info(isspaceturf(get_z_base_turf()))

return INITIALIZE_HINT_NORMAL
Expand Down
4 changes: 2 additions & 2 deletions code/modules/atmospherics/environmental/LINDA_turf_tile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
/turf/open/Initialize(mapload, inherited_virtual_z)
air = new(2500,src)
air.copy_from_turf(src)
update_air_ref(planetary_atmos ? 1 : 2)
. = ..()
update_air_ref(planetary_atmos ? AIR_REF_PLANETARY_TURF : AIR_REF_OPEN_TURF)
return ..()

/turf/open/Destroy()
if(active_hotspot)
Expand Down
2 changes: 1 addition & 1 deletion dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export PYTHON_VERSION=3.7.9
export AUXMOS_REPO=https://github.com/Putnam3145/auxmos

#auxmos version
export AUXMOS_VERSION=b7df056b5eb7a8d56837d92a6c224c6367198bb8
export AUXMOS_VERSION=de6f041596573da4f058fe51fb4068acdaf01988

0 comments on commit 7d7ecb2

Please sign in to comment.