Skip to content

Commit

Permalink
Merge pull request #15864 from Putnam3145/auxmos-2
Browse files Browse the repository at this point in the history
UPDATE AUXMOS TO 2.0.0 (TESTMERGE THIS HOLY CRAP)
  • Loading branch information
Linzolle authored Apr 1, 2023
2 parents 03f15a2 + a23e7a0 commit 654e5da
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 66 deletions.
Binary file modified auxmos.dll
Binary file not shown.
Binary file modified auxmos.pdb
Binary file not shown.
12 changes: 4 additions & 8 deletions code/__DEFINES/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
#define ATMOS_PASS_PROC -1 //ask CanAtmosPass()
#define ATMOS_PASS_DENSITY -2 //just check density

// Adjacency flags
#define ATMOS_ADJACENT_ANY (1<<0)
#define ATMOS_ADJACENT_FIRELOCK (1<<1)

#define CANATMOSPASS(A, O) ( A.CanAtmosPass == ATMOS_PASS_PROC ? A.CanAtmosPass(O) : ( A.CanAtmosPass == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPass ) )
#define CANVERTICALATMOSPASS(A, O) ( A.CanAtmosPassVertical == ATMOS_PASS_PROC ? A.CanAtmosPass(O, TRUE) : ( A.CanAtmosPassVertical == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPassVertical ) )

Expand Down Expand Up @@ -323,14 +327,6 @@
#define QUANTIZE(variable) (round(variable,0.0000001))/*I feel the need to document what happens here. Basically this is used to catch most rounding errors, however it's previous value made it so that
once gases got hot enough, most procedures wouldnt occur due to the fact that the mole counts would get rounded away. Thus, we lowered it a few orders of magnititude */


#ifdef TESTING
GLOBAL_LIST_INIT(atmos_adjacent_savings, list(0,0))
#define CALCULATE_ADJACENT_TURFS(T) if (SSadjacent_air.queue[T]) { GLOB.atmos_adjacent_savings[1] += 1 } else { GLOB.atmos_adjacent_savings[2] += 1; SSadjacent_air.queue[T] = 1 }
#else
#define CALCULATE_ADJACENT_TURFS(T) SSadjacent_air.queue[T] = 1
#endif

//If you're doing spreading things related to atmos, DO NOT USE CANATMOSPASS, IT IS NOT CHEAP. use this instead, the info is cached after all. it's tweaked just a bit to allow for circular checks
#define TURFS_CAN_SHARE(T1, T2) (LAZYACCESS(T2.atmos_adjacent_turfs, T1) || LAZYLEN(T1.atmos_adjacent_turfs & T2.atmos_adjacent_turfs))

Expand Down
39 changes: 0 additions & 39 deletions code/controllers/subsystem/adjacent_air.dm

This file was deleted.

20 changes: 20 additions & 0 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
/obj/machinery/door/firedoor/Initialize(mapload)
. = ..()
CalculateAffectingAreas()
UpdateAdjacencyFlags()


/obj/machinery/door/firedoor/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -81,6 +83,24 @@
var/area/A = I
LAZYADD(A.firedoors, src)

/obj/machinery/door/firedoor/proc/UpdateAdjacencyFlags()
var/turf/T = get_turf(src)
if(flags_1 & ON_BORDER_1)
for(var/t in T.atmos_adjacent_turfs)
if(get_dir(loc, t) == dir)
var/turf/open/T2 = t
if(T2 in T.atmos_adjacent_turfs)
T.atmos_adjacent_turfs[T2] |= ATMOS_ADJACENT_FIRELOCK
if(T in T2.atmos_adjacent_turfs)
T2.atmos_adjacent_turfs[T] |= ATMOS_ADJACENT_FIRELOCK
else
for(var/t in T.atmos_adjacent_turfs)
var/turf/open/T2 = t
if(T2 in T.atmos_adjacent_turfs)
T.atmos_adjacent_turfs[T2] |= ATMOS_ADJACENT_FIRELOCK
if(T in T2.atmos_adjacent_turfs)
T2.atmos_adjacent_turfs[T] |= ATMOS_ADJACENT_FIRELOCK

/obj/machinery/door/firedoor/closed
icon_state = "door_closed"
opacity = TRUE
Expand Down
7 changes: 2 additions & 5 deletions code/game/turfs/change_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(

if(turf_type)
var/turf/newT = ChangeTurf(turf_type, baseturf_type, flags)
CALCULATE_ADJACENT_TURFS(newT)
newT.ImmediateCalculateAdjacentTurfs()

/turf/proc/copyTurf(turf/T)
if(T.type != type)
Expand Down Expand Up @@ -285,10 +285,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
//If you modify this function, ensure it works correctly with lateloaded map templates.
/turf/proc/AfterChange(flags) //called after a turf has been replaced in ChangeTurf()
levelupdate()
if(flags & CHANGETURF_RECALC_ADJACENT)
ImmediateCalculateAdjacentTurfs()
else
CALCULATE_ADJACENT_TURFS(src)
ImmediateCalculateAdjacentTurfs()

//update firedoor adjacency
var/list/turfs_to_check = get_adjacent_open_turfs(src) | src
Expand Down
4 changes: 2 additions & 2 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
add_overlay(/obj/effect/fullbright)

if(requires_activation)
CALCULATE_ADJACENT_TURFS(src)
ImmediateCalculateAdjacentTurfs()

if (light_power && light_range)
update_light()
Expand Down Expand Up @@ -111,7 +111,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
/turf/proc/set_temperature()

/turf/proc/Initalize_Atmos(times_fired)
CALCULATE_ADJACENT_TURFS(src)
ImmediateCalculateAdjacentTurfs()

/turf/Destroy(force)
. = QDEL_HINT_IWILLGC
Expand Down
15 changes: 8 additions & 7 deletions code/modules/atmospherics/environmental/LINDA_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,17 @@
return FALSE

/turf/proc/ImmediateCalculateAdjacentTurfs()
if(SSair.thread_running())
CALCULATE_ADJACENT_TURFS(src)
return
var/canpass = CANATMOSPASS(src, src)
var/canvpass = CANVERTICALATMOSPASS(src, src)
for(var/direction in GLOB.cardinals_multiz)
var/turf/T = get_step_multiz(src, direction)
if(!istype(T))
continue
var/opp_dir = REVERSE_DIR(direction)
if(isopenturf(T) && !(blocks_air || T.blocks_air) && ((direction & (UP|DOWN))? (canvpass && CANVERTICALATMOSPASS(T, src)) : (canpass && CANATMOSPASS(T, src))) )
LAZYINITLIST(atmos_adjacent_turfs)
LAZYINITLIST(T.atmos_adjacent_turfs)
atmos_adjacent_turfs[T] = direction
T.atmos_adjacent_turfs[src] = opp_dir
atmos_adjacent_turfs[T] = ATMOS_ADJACENT_ANY
T.atmos_adjacent_turfs[src] = ATMOS_ADJACENT_ANY
else
if (atmos_adjacent_turfs)
atmos_adjacent_turfs -= T
Expand All @@ -65,7 +61,12 @@
T.__update_auxtools_turf_adjacency_info(isspaceturf(T.get_z_base_turf()), -1)
UNSETEMPTY(atmos_adjacent_turfs)
src.atmos_adjacent_turfs = atmos_adjacent_turfs
set_sleeping(blocks_air)
for(var/t in atmos_adjacent_turfs)
var/turf/open/T = t
for(var/obj/machinery/door/firedoor/FD in T)
FD.UpdateAdjacencyFlags()
for(var/obj/machinery/door/firedoor/FD in src)
FD.UpdateAdjacencyFlags()
__update_auxtools_turf_adjacency_info(isspaceturf(get_z_base_turf()))

/turf/proc/set_sleeping(should_sleep)
Expand Down
6 changes: 5 additions & 1 deletion code/modules/atmospherics/gasmixtures/gas_mixture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,12 @@ we use a hook instead
parse_gas_string(model.initial_gas_mix)
return 1

/datum/gas_mixture/proc/__auxtools_parse_gas_string(gas_string)

/datum/gas_mixture/parse_gas_string(gas_string)
gas_string = SSair.preprocess_gas_string(gas_string)

return __auxtools_parse_gas_string(gas_string)
/*
var/list/gas = params2list(gas_string)
if(gas["TEMP"])
var/temp = text2num(gas["TEMP"])
Expand All @@ -295,6 +298,7 @@ we use a hook instead
set_moles(id, text2num(gas[id]))
archive()
return 1
*/
/*
/datum/gas_mixture/react(datum/holder)
. = NO_REACTION
Expand Down
2 changes: 1 addition & 1 deletion code/modules/holodeck/area_copy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars_by_type, typecacheof_assoc_list(list(

if(toupdate.len)
for(var/turf/T1 in toupdate)
CALCULATE_ADJACENT_TURFS(T1)
T1.ImmediateCalculateAdjacentTurfs()


return copiedobjs
2 changes: 1 addition & 1 deletion code/modules/power/supermatter/supermatter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
playsound(T, 'sound/effects/supermatter.ogg', 50, 1)
T.visible_message("<span class='danger'>[T] smacks into [src] and rapidly flashes to ash.</span>",\
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
CALCULATE_ADJACENT_TURFS(T)
T.ImmediateCalculateAdjacentTurfs()

//Do not blow up our internal radio
/obj/machinery/power/supermatter_crystal/contents_explosion(severity, target, origin)
Expand Down
2 changes: 1 addition & 1 deletion dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export SPACEMAN_DMM_VERSION=suite-1.7
export PYTHON_VERSION=3.7.9

# Auxmos git tag
export AUXMOS_VERSION=v1.1.1
export AUXMOS_VERSION=v2.2.1

# Extools git tag
export EXTOOLS_VERSION=v0.0.7
1 change: 0 additions & 1 deletion tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@
#include "code\controllers\configuration\entries\vote.dm"
#include "code\controllers\subsystem\achievements.dm"
#include "code\controllers\subsystem\activity.dm"
#include "code\controllers\subsystem\adjacent_air.dm"
#include "code\controllers\subsystem\air.dm"
#include "code\controllers\subsystem\assets.dm"
#include "code\controllers\subsystem\atoms.dm"
Expand Down

0 comments on commit 654e5da

Please sign in to comment.