From ec18de7d7913e54b9b5e745375fec197889d5f24 Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Wed, 23 Oct 2024 05:47:09 -0700 Subject: [PATCH 1/4] Replace all air_master nonsense with SSair --- .../components/unary/heat_exchanger.dm | 6 ++--- code/ZAS/Atom.dm | 4 ++-- code/ZAS/Connection.dm | 16 +++++++------- code/ZAS/ConnectionGroup.dm | 20 ++++++++--------- code/ZAS/ConnectionManager.dm | 2 +- code/ZAS/Controller.dm | 4 +--- code/ZAS/Diagnostic.dm | 4 ++-- code/ZAS/Fire.dm | 8 +++---- code/ZAS/Turf.dm | 14 ++++++------ code/ZAS/Zone.dm | 18 +++++++-------- code/ZAS/_docs.dm | 2 +- code/_helpers/unsorted.dm | 2 +- code/controllers/subsystems/air.dm | 7 ++---- code/controllers/verbs.dm | 1 - code/game/machinery/doors/door.dm | 4 ++-- code/game/machinery/doors/firedoor.dm | 6 ++--- code/game/objects/effects/zone_divider.dm | 4 ++-- code/game/objects/items/blueprints.dm | 4 ++-- code/game/objects/items/blueprints_vr.dm | 8 +++---- code/game/turfs/simulated/wall_attacks.dm | 8 +++---- code/game/turfs/turf_changing.dm | 6 ++--- code/game/turfs/unsimulated/planetary.dm | 3 +-- code/modules/admin/verbs/buildmode.dm | 4 ++-- code/modules/admin/verbs/diagnostics.dm | 22 +++++++++---------- code/modules/admin/verbs/mapping.dm | 4 ++-- code/modules/hydroponics/seed.dm | 4 ++-- code/modules/mining/mine_turfs.dm | 4 ++-- code/modules/mob/living/carbon/breathe.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 2 +- .../silicon/robot/dogborg/dog_sleeper_vr.dm | 2 +- .../subtypes/vore/solargrub_larva.dm | 2 +- code/unit_tests/map_tests.dm | 4 ++-- 32 files changed, 97 insertions(+), 104 deletions(-) diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index 7b6a5621eb1..078c97af8a1 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -36,11 +36,11 @@ if(!partner) return 0 - if(!air_master || air_master.current_cycle <= update_cycle) + if(!SSair || SSair.current_cycle <= update_cycle) return 0 - update_cycle = air_master.current_cycle - partner.update_cycle = air_master.current_cycle + update_cycle = SSair.current_cycle + partner.update_cycle = SSair.current_cycle var/air_heat_capacity = air_contents.heat_capacity() var/other_air_heat_capacity = partner.air_contents.heat_capacity() diff --git a/code/ZAS/Atom.dm b/code/ZAS/Atom.dm index bfe6fa2ad4d..eeb01b42495 100644 --- a/code/ZAS/Atom.dm +++ b/code/ZAS/Atom.dm @@ -36,11 +36,11 @@ //Convenience function for atoms to update turfs they occupy /atom/movable/proc/update_nearby_tiles(need_rebuild) - if(!air_master) + if(!SSair) return 0 for(var/turf/simulated/turf in locs) - air_master.mark_for_update(turf) + SSair.mark_for_update(turf) return 1 diff --git a/code/ZAS/Connection.dm b/code/ZAS/Connection.dm index 21be29d25e1..e0549366cbc 100644 --- a/code/ZAS/Connection.dm +++ b/code/ZAS/Connection.dm @@ -5,7 +5,7 @@ /* Overview: - Connections are made between turfs by air_master.connect(). They represent a single point where two zones converge. + Connections are made between turfs by SSair.connect(). They represent a single point where two zones converge. Class Vars: A - Always a simulated turf. @@ -60,19 +60,19 @@ Class Procs: /connection/New(turf/simulated/A, turf/simulated/B) #ifdef ZASDBG - ASSERT(air_master.has_valid_zone(A)) - //ASSERT(air_master.has_valid_zone(B)) + ASSERT(SSair.has_valid_zone(A)) + //ASSERT(SSair.has_valid_zone(B)) #endif src.A = A src.B = B zoneA = A.zone if(!istype(B)) mark_space() - edge = air_master.get_edge(A.zone,B) + edge = SSair.get_edge(A.zone,B) edge.add_connection(src) else zoneB = B.zone - edge = air_master.get_edge(A.zone,B.zone) + edge = SSair.get_edge(A.zone,B.zone) edge.add_connection(src) /connection/proc/mark_direct() @@ -108,7 +108,7 @@ Class Procs: erase() return - var/block_status = air_master.air_blocked(A,B) + var/block_status = SSair.air_blocked(A,B) if(block_status & AIR_BLOCKED) //to_world("Blocked connection.") erase() @@ -133,7 +133,7 @@ Class Procs: return else edge.remove_connection(src) - edge = air_master.get_edge(A.zone, B) + edge = SSair.get_edge(A.zone, B) edge.add_connection(src) zoneA = A.zone @@ -155,7 +155,7 @@ Class Procs: //to_world("Zones changed, \...") if(A.zone && B.zone) edge.remove_connection(src) - edge = air_master.get_edge(A.zone, B.zone) + edge = SSair.get_edge(A.zone, B.zone) edge.add_connection(src) zoneA = A.zone zoneB = B.zone diff --git a/code/ZAS/ConnectionGroup.dm b/code/ZAS/ConnectionGroup.dm index 0be44bb3584..85b2545d36e 100644 --- a/code/ZAS/ConnectionGroup.dm +++ b/code/ZAS/ConnectionGroup.dm @@ -2,7 +2,7 @@ Overview: These are what handle gas transfers between zones and into space. - They are found in a zone's edges list and in air_master.edges. + They are found in a zone's edges list and in SSair.edges. Each edge updates every air tick due to their role in gas transfer. They come in two flavors, /connection_edge/zone and /connection_edge/unsimulated. As the type names might suggest, they handle inter-zone and spacelike connections respectively. @@ -82,7 +82,7 @@ Class Procs: /connection_edge/proc/contains_zone(zone/Z) /connection_edge/proc/erase() - air_master.remove_edge(src) + SSair.remove_edge(src) //to_world("[type] Erased.") /connection_edge/proc/tick() @@ -169,19 +169,19 @@ Class Procs: if(equiv) if(direct) erase() - air_master.merge(A, B) + SSair.merge(A, B) return else A.air.equalize(B.air) - air_master.mark_edge_sleeping(src) + SSair.mark_edge_sleeping(src) - air_master.mark_zone_update(A) - air_master.mark_zone_update(B) + SSair.mark_zone_update(A) + SSair.mark_zone_update(B) /connection_edge/zone/recheck() // Edges with only one side being vacuum need processing no matter how close. if(!A.air.compare(B.air, vacuum_exception = 1)) - air_master.mark_edge_active(src) + SSair.mark_edge_active(src) //Helper proc to get connections for a zone. /connection_edge/zone/proc/get_connected_zone(zone/from) @@ -233,16 +233,16 @@ Class Procs: if(equiv) A.air.copy_from(air) - air_master.mark_edge_sleeping(src) + SSair.mark_edge_sleeping(src) - air_master.mark_zone_update(A) + SSair.mark_zone_update(A) /connection_edge/unsimulated/recheck() // Edges with only one side being vacuum need processing no matter how close. // Note: This handles the glaring flaw of a room holding pressure while exposed to space, but // does not specially handle the less common case of a simulated room exposed to an unsimulated pressurized turf. if(!A.air.compare(air, vacuum_exception = 1)) - air_master.mark_edge_active(src) + SSair.mark_edge_active(src) /proc/ShareHeat(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles) //This implements a simplistic version of the Stefan-Boltzmann law. diff --git a/code/ZAS/ConnectionManager.dm b/code/ZAS/ConnectionManager.dm index 3890cd85f5c..8d7e270cde0 100644 --- a/code/ZAS/ConnectionManager.dm +++ b/code/ZAS/ConnectionManager.dm @@ -16,7 +16,7 @@ Class Procs: Preferable to accessing the connection directly because it checks validity. place(connection/c, d) - Called by air_master.connect(). Sets the connection in the specified direction to c. + Called by SSair.connect(). Sets the connection in the specified direction to c. update_all() Called after turf/update_air_properties(). Updates the validity of all connections on this turf. diff --git a/code/ZAS/Controller.dm b/code/ZAS/Controller.dm index 7f7b5752469..d3ada5e3116 100644 --- a/code/ZAS/Controller.dm +++ b/code/ZAS/Controller.dm @@ -1,5 +1,3 @@ -var/datum/controller/subsystem/air/air_master - var/tick_multiplier = 2 /* @@ -133,7 +131,7 @@ Class Procs: ASSERT(A != B) #endif - var/block = air_master.air_blocked(A,B) + var/block = SSair.air_blocked(A,B) if(block & AIR_BLOCKED) return var/direct = !(block & ZONE_BLOCKED) diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm index fba24568028..7893ba42624 100644 --- a/code/ZAS/Diagnostic.dm +++ b/code/ZAS/Diagnostic.dm @@ -8,12 +8,12 @@ /* if(!check_rights(R_DEBUG)) return - var/result = air_master.Tick() + var/result = SSair.Tick() if(result) to_chat(src, "Successfully Processed.") else - to_chat(src, "Failed to process! ([air_master.tick_progress])") + to_chat(src, "Failed to process! ([SSair.tick_progress])") */ /client/proc/Zone_Info(turf/T as null|turf) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 5c3a24d882a..8c1e4afa064 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -58,7 +58,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin fuel_objs.Cut() if(!fire_tiles.len) - air_master.active_fire_zones.Remove(src) + SSair.active_fire_zones.Remove(src) /zone/proc/remove_liquidfuel(var/used_liquid_fuel, var/remove_fire=0) if(!fuel_objs.len) @@ -94,7 +94,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin return 1 fire = new(src, fl) - air_master.active_fire_zones |= zone + SSair.active_fire_zones |= zone var/obj/effect/decal/cleanable/liquid_fuel/fuel = locate() in src zone.fire_tiles |= src @@ -191,7 +191,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin set_light(3, 1, color) firelevel = fl - air_master.active_hotspots.Add(src) + SSair.active_hotspots.Add(src) /obj/fire/proc/fire_color(var/env_temperature) var/temperature = max(4000*sqrt(firelevel/vsc.fire_firelevel_multiplier), env_temperature) @@ -209,7 +209,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin T.fire = null loc = null - air_master.active_hotspots.Remove(src) + SSair.active_hotspots.Remove(src) /turf/simulated/var/fire_protection = 0 //Protects newly extinguished tiles from being overrun again. diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm index c05e708036b..f8bfc5ae83c 100644 --- a/code/ZAS/Turf.dm +++ b/code/ZAS/Turf.dm @@ -41,9 +41,9 @@ if(istype(unsim, /turf/simulated)) var/turf/simulated/sim = unsim - if(air_master.has_valid_zone(sim)) + if(SSair.has_valid_zone(sim)) - air_master.connect(sim, src) + SSair.connect(sim, src) /* Simple heuristic for determining if removing the turf from it's zone will not partition the zone (A very bad thing). @@ -162,7 +162,7 @@ var/turf/simulated/sim = unsim sim.open_directions |= reverse_dir[d] - if(air_master.has_valid_zone(sim)) + if(SSair.has_valid_zone(sim)) //Might have assigned a zone, since this happens for each direction. if(!zone) @@ -195,7 +195,7 @@ if(verbose) to_world("Connecting to [sim.zone]") #endif - air_master.connect(src, sim) + SSair.connect(src, sim) #ifdef ZASDBG @@ -210,7 +210,7 @@ if(!postponed) postponed = list() postponed.Add(unsim) - if(!air_master.has_valid_zone(src)) //Still no zone, make a new one. + if(!SSair.has_valid_zone(src)) //Still no zone, make a new one. var/zone/newzone = new/zone() newzone.add(src) @@ -223,7 +223,7 @@ //At this point, a zone should have happened. If it hasn't, don't add more checks, fix the bug. for(var/turf/T in postponed) - air_master.connect(src, T) + SSair.connect(src, T) /turf/proc/post_update_air_properties() if(connections) connections.update_all() @@ -279,7 +279,7 @@ /turf/simulated/return_air() if(zone) if(!zone.invalid) - air_master.mark_zone_update(zone) + SSair.mark_zone_update(zone) return zone.air else if(!air) diff --git a/code/ZAS/Zone.dm b/code/ZAS/Zone.dm index d07a280d040..db686ce8f05 100644 --- a/code/ZAS/Zone.dm +++ b/code/ZAS/Zone.dm @@ -56,7 +56,7 @@ Class Procs: /zone/var/list/graphic_remove = list() /zone/New() - air_master.add_zone(src) + SSair.add_zone(src) air.temperature = TCMB air.group_multiplier = 1 air.volume = CELL_VOLUME @@ -65,7 +65,7 @@ Class Procs: #ifdef ZASDBG ASSERT(!invalid) ASSERT(istype(T)) - ASSERT(!air_master.has_valid_zone(T)) + ASSERT(!SSair.has_valid_zone(T)) #endif var/datum/gas_mixture/turf_air = T.return_air() @@ -75,7 +75,7 @@ Class Procs: if(T.fire) var/obj/effect/decal/cleanable/liquid_fuel/fuel = locate() in T fire_tiles.Add(T) - air_master.active_fire_zones |= src + SSair.active_fire_zones |= src if(fuel) fuel_objs += fuel if(air.graphic) T.update_graphic(air.graphic) @@ -122,11 +122,11 @@ Class Procs: if(E.contains_zone(into)) continue //don't need to rebuild this edge for(var/turf/T in E.connecting_turfs) - air_master.mark_for_update(T) + SSair.mark_for_update(T) /zone/proc/c_invalidate() invalid = 1 - air_master.remove_zone(src) + SSair.remove_zone(src) #ifdef ZASDBG for(var/turf/simulated/T in contents) T.dbg(invalid_zone) @@ -141,7 +141,7 @@ Class Procs: T.update_graphic(graphic_remove = air_graphic) //we need to remove the overlays so they're not doubled when the zone is rebuilt //T.dbg(invalid_zone) T.needs_air_update = 0 //Reset the marker so that it will be added to the list. - air_master.mark_for_update(T) + SSair.mark_for_update(T) /zone/proc/add_tile_air(datum/gas_mixture/tile_air) //air.volume += CELL_VOLUME @@ -152,7 +152,7 @@ Class Procs: air.group_multiplier = contents.len+1 /zone/proc/tick() - if(air.temperature >= PHORON_FLASHPOINT && !(src in air_master.active_fire_zones) && air.check_combustability() && contents.len) + if(air.temperature >= PHORON_FLASHPOINT && !(src in SSair.active_fire_zones) && air.check_combustability() && contents.len) var/turf/T = pick(contents) if(istype(T)) T.create_fire(vsc.fire_firelevel_multiplier) @@ -171,7 +171,7 @@ Class Procs: to_chat(M,name) for(var/g in air.gas) to_chat(M, "[gas_data.name[g]]: [air.gas[g]]") - to_chat(M, "P: [air.return_pressure()] kPa V: [air.volume]L T: [air.temperature]°K ([air.temperature - T0C]°C)") + to_chat(M, "P: [air.return_pressure()] kPa V: [air.volume]L T: [air.temperature]�K ([air.temperature - T0C]�C)") to_chat(M, "O2 per N2: [(air.gas["nitrogen"] ? air.gas["oxygen"]/air.gas["nitrogen"] : "N/A")] Moles: [air.total_moles]") to_chat(M, "Simulated: [contents.len] ([air.group_multiplier])") //to_chat(M, "Unsimulated: [unsimulated_contents.len]") @@ -192,4 +192,4 @@ Class Procs: to_chat(M, "Space Edges: [space_edges] ([space_coefficient] connections)") //for(var/turf/T in unsimulated_contents) - // to_chat(M, "[T] at ([T.x],[T.y])") \ No newline at end of file + // to_chat(M, "[T] at ([T.x],[T.y])") diff --git a/code/ZAS/_docs.dm b/code/ZAS/_docs.dm index 382f1f0abbf..822c8ac7b2a 100644 --- a/code/ZAS/_docs.dm +++ b/code/ZAS/_docs.dm @@ -15,7 +15,7 @@ Every air tick: Important Functions: -air_master.mark_for_update(turf) +SSair.mark_for_update(turf) When stuff happens, call this. It works on everything. You basically don't need to worry about any other functions besides CanPass(). diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 057f988dcb9..59be2633d78 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -974,7 +974,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if(toupdate.len) for(var/turf/simulated/T1 in toupdate) - air_master.mark_for_update(T1) + SSair.mark_for_update(T1) return copiedobjs diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index 1e5f1506ec6..d84f591436f 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -30,9 +30,6 @@ SUBSYSTEM_DEF(air) // This is used to tell CI WHERE the edges are. var/list/startup_active_edge_log = list() -/datum/controller/subsystem/air/PreInit() - air_master = src - /datum/controller/subsystem/air/Initialize(timeofday) report_progress("Processing Geometry...") @@ -109,7 +106,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun log_and_message_admins("SSair: Was told to start a new run, but the previous run wasn't finished! currentrun.len=[currentrun.len], current_step=[current_step]") resumed = TRUE else - current_cycle++ // Begin a new air_master cycle! + current_cycle++ // Begin a new SSair cycle! current_step = SSAIR_TURFS // Start with Step 1 of course INTERNAL_PROCESS_STEP(SSAIR_TURFS, TRUE, process_tiles_to_update, cost_turfs, SSAIR_EDGES) @@ -118,7 +115,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun INTERNAL_PROCESS_STEP(SSAIR_HOTSPOTS, FALSE, process_active_hotspots, cost_hotspots, SSAIR_ZONES) INTERNAL_PROCESS_STEP(SSAIR_ZONES, FALSE, process_zones_to_update, cost_zones, SSAIR_DONE) - // Okay, we're done! Woo! Got thru a whole air_master cycle! + // Okay, we're done! Woo! Got thru a whole SSair cycle! if(LAZYLEN(currentrun) || current_step != SSAIR_DONE) log_and_message_admins("SSair: Was not able to complete a full air cycle despite reaching the end of fire(). This shouldn't happen.") else diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index fee7da9b853..150d482360a 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -89,7 +89,6 @@ //Goon PS stuff, and other yet-to-be-subsystem things. options["LEGACY: master_controller"] = master_controller - options["LEGACY: air_master"] = air_master options["LEGACY: job_master"] = job_master options["LEGACY: radio_controller"] = radio_controller options["LEGACY: emergency_shuttle"] = emergency_shuttle diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 2f70e0436e0..8055af222cc 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -437,12 +437,12 @@ return ..(M) /obj/machinery/door/update_nearby_tiles(need_rebuild) - if(!air_master) + if(!SSair) return 0 for(var/turf/simulated/turf in locs) update_heat_protection(turf) - air_master.mark_for_update(turf) + SSair.mark_for_update(turf) return 1 diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index d4477eeac00..4502ed93343 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -501,15 +501,15 @@ update_nearby_tiles(need_rebuild) - if(!air_master) return 0 + if(!SSair) return 0 var/turf/simulated/source = loc var/turf/simulated/destination = get_step(source,dir) update_heat_protection(loc) - if(istype(source)) air_master.tiles_to_update += source - if(istype(destination)) air_master.tiles_to_update += destination + if(istype(source)) SSair.tiles_to_update += source + if(istype(destination)) SSair.tiles_to_update += destination return 1 */ diff --git a/code/game/objects/effects/zone_divider.dm b/code/game/objects/effects/zone_divider.dm index fa2ea82531c..3638219b20f 100644 --- a/code/game/objects/effects/zone_divider.dm +++ b/code/game/objects/effects/zone_divider.dm @@ -13,8 +13,8 @@ // Special case to prevent us from being part of a zone during the first air master tick. // We must merge ourselves into a zone on next tick. This will cause a bit of lag on // startup, but it can't really be helped you know? - if(air_master && air_master.current_cycle == 0) + if(SSair && SSair.current_cycle == 0) spawn(1) - air_master.mark_for_update(get_turf(src)) + SSair.mark_for_update(get_turf(src)) return FALSE return is_zone ? FALSE : TRUE // Anything except zones can pass diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 84b8d743f6c..c0f82b0b153 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -251,9 +251,9 @@ if (!isturf(NT) || (NT in found) || (NT in pending)) continue // We ask ZAS to determine if its airtight. Thats what matters anyway right? - if(air_master.air_blocked(T, NT)) + if(SSair.air_blocked(T, NT)) // Okay thats the edge of the room - if(get_area_type(NT.loc) == AREA_SPACE && air_master.air_blocked(NT, NT)) + if(get_area_type(NT.loc) == AREA_SPACE && SSair.air_blocked(NT, NT)) found += NT // So we include walls/doors not already in any area continue if (istype(NT, /turf/space)) diff --git a/code/game/objects/items/blueprints_vr.dm b/code/game/objects/items/blueprints_vr.dm index 336a6219d90..214bbff5185 100644 --- a/code/game/objects/items/blueprints_vr.dm +++ b/code/game/objects/items/blueprints_vr.dm @@ -678,9 +678,9 @@ if(!visual && forbiddenAreas[NT.loc.type]) return ROOM_ERR_FORBIDDEN // We ask ZAS to determine if its airtight. Thats what matters anyway right? - if(air_master.air_blocked(T, NT)) + if(SSair.air_blocked(T, NT)) // Okay thats the edge of the room - if(get_area_type(NT.loc) == AREA_SPACE && air_master.air_blocked(NT, NT)) + if(get_area_type(NT.loc) == AREA_SPACE && SSair.air_blocked(NT, NT)) found += NT // So we include walls/doors not already in any area continue if (istype(NT, /turf/space)) @@ -835,9 +835,9 @@ if(!get_new_area_type(NT.loc) == 1) //The contains somewhere that is NOT a buildable area. return 3 //NOT A BUILDABLE AREA - if(air_master.air_blocked(T, NT)) //Is the room airtight? + if(SSair.air_blocked(T, NT)) //Is the room airtight? // Okay thats the edge of the room - if(get_new_area_type(NT.loc) == 1 && air_master.air_blocked(NT, NT)) + if(get_new_area_type(NT.loc) == 1 && SSair.air_blocked(NT, NT)) found += NT // So we include walls/doors not already in any area continue if (istype(NT, /turf/space)) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index d7630618e2b..cfc998f72a1 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -17,7 +17,7 @@ src.blocks_air = 0 set_opacity(0) for(var/turf/simulated/turf in loc) - air_master.mark_for_update(turf) + SSair.mark_for_update(turf) else can_open = WALL_OPENING //flick("[material.icon_base]fwall_closing", src) @@ -29,18 +29,18 @@ src.blocks_air = 1 set_opacity(1) for(var/turf/simulated/turf in loc) - air_master.mark_for_update(turf) + SSair.mark_for_update(turf) can_open = WALL_CAN_OPEN update_icon() /turf/simulated/wall/proc/update_air() - if(!air_master) + if(!SSair) return for(var/turf/simulated/turf in loc) update_thermal(turf) - air_master.mark_for_update(turf) + SSair.mark_for_update(turf) /turf/simulated/wall/proc/update_thermal(var/turf/simulated/source) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 72cb432e1bc..11afc9e0420 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -28,7 +28,7 @@ if(N == /turf/space) var/turf/below = GetBelow(src) - if(istype(below) && (air_master.has_valid_zone(below) || air_master.has_valid_zone(src)) && !(src.z in using_map.below_blocked_levels) && (!istype(below, /turf/unsimulated/wall) && !istype(below, /turf/simulated/sky))) // VOREStation Edit: Weird open space + if(istype(below) && (SSair.has_valid_zone(below) || SSair.has_valid_zone(src)) && !(src.z in using_map.below_blocked_levels) && (!istype(below, /turf/unsimulated/wall) && !istype(below, /turf/simulated/sky))) // VOREStation Edit: Weird open space N = /turf/simulated/open var/obj/fire/old_fire = fire @@ -75,8 +75,8 @@ if(tell_universe) universe.OnTurfChange(W) - if(air_master) - air_master.mark_for_update(W) + if(SSair) + SSair.mark_for_update(W) for(var/turf/space/S in range(W, 1)) S.update_starlight() diff --git a/code/game/turfs/unsimulated/planetary.dm b/code/game/turfs/unsimulated/planetary.dm index c6be94c5ed0..d73201c1661 100644 --- a/code/game/turfs/unsimulated/planetary.dm +++ b/code/game/turfs/unsimulated/planetary.dm @@ -33,7 +33,7 @@ // Force ZAS to reconsider our connections because our temperature has changed if(connections) connections.erase_all() - air_master.mark_for_update(src) + SSair.mark_for_update(src) // Normal station/earth air. /turf/unsimulated/wall/planetary/normal @@ -67,4 +67,3 @@ oxygen = MOLES_O2STANDARD nitrogen = MOLES_N2STANDARD temperature = 310.92 // About 37.7C / 100F - diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm index 922e3c326ef..aa3efca68dc 100644 --- a/code/modules/admin/verbs/buildmode.dm +++ b/code/modules/admin/verbs/buildmode.dm @@ -830,9 +830,9 @@ if (!isturf(NT) || (NT in found) || (NT in pending)) continue // We ask ZAS to determine if its airtight. Thats what matters anyway right? - if(air_master.air_blocked(T, NT)) + if(SSair.air_blocked(T, NT)) // Okay thats the edge of the room - if(get_area_type_buildmode(NT.loc) == AREA_SPACE && air_master.air_blocked(NT, NT)) + if(get_area_type_buildmode(NT.loc) == AREA_SPACE && SSair.air_blocked(NT, NT)) found += NT // So we include walls/doors not already in any area continue if (istype(NT, /turf/space)) diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 1ce73a7f742..3e9a81b3190 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -2,12 +2,12 @@ set category = "Debug" set name = "Show Air Report" - if(!master_controller || !air_master) - tgui_alert_async(usr,"Master_controller or air_master not found.","Air Report") + if(!master_controller || !SSair) + tgui_alert_async(usr,"Master_controller or SSair not found.","Air Report") return - var/active_groups = air_master.active_zones - var/inactive_groups = air_master.zones.len - active_groups + var/active_groups = SSair.active_zones + var/inactive_groups = SSair.zones.len - active_groups var/hotspots = 0 for(var/obj/fire/hotspot in world) @@ -15,7 +15,7 @@ var/active_on_main_station = 0 var/inactive_on_main_station = 0 - for(var/zone/zone in air_master.zones) + for(var/zone/zone in SSair.zones) var/turf/simulated/turf = locate() in zone.contents if(turf?.z in using_map.station_levels) if(zone.needs_update) @@ -25,8 +25,8 @@ var/output = {"AIR SYSTEMS REPORT
General Processing Data
- Cycle: [air_master.current_cycle]
- Groups: [air_master.zones.len]
+ Cycle: [SSair.current_cycle]
+ Groups: [SSair.zones.len]
---- Active: [active_groups]
---- Inactive: [inactive_groups]

---- Active on station: [active_on_main_station]
@@ -36,7 +36,7 @@ Hotspot Processing: [hotspots]

Geometry Processing Data
- Tile Update: [air_master.tiles_to_update.len]
+ Tile Update: [SSair.tiles_to_update.len]
"} usr << browse(output,"window=airreport") @@ -127,11 +127,11 @@ to_chat(src, "Only administrators may use this command.") return - if(!air_master) + if(!SSair) to_chat(usr, "Cannot find air_system") return var/datum/air_group/dead_groups = list() - for(var/datum/air_group/group in air_master.air_groups) + for(var/datum/air_group/group in SSair.air_groups) if (!group.group_processing) dead_groups += group var/datum/air_group/dest_group = pick(dead_groups) @@ -149,7 +149,7 @@ to_chat(src, "Only administrators may use this command.") return - if(!air_master) + if(!SSair) to_chat(usr, "Cannot find air_system") return diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index c51b131b8e2..9b43a08bf4c 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -354,7 +354,7 @@ var/global/prevent_airgroup_regroup = 0 set name = "Break All Airgroups" /*prevent_airgroup_regroup = 1 - for(var/datum/air_group/AG in air_master.air_groups) + for(var/datum/air_group/AG in SSair.air_groups) AG.suspend_group_processing() message_admins("[src.ckey] used 'Break All Airgroups'")*/ @@ -365,7 +365,7 @@ var/global/prevent_airgroup_regroup = 0 to_chat(usr, span_red("Proc disabled.")) //Why not.. Delete the procs instead? /*prevent_airgroup_regroup = 0 - for(var/datum/air_group/AG in air_master.air_groups) + for(var/datum/air_group/AG in SSair.air_groups) AG.check_regroup() message_admins("[src.ckey] used 'Regroup All Airgroups Attempt'")*/ diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 61b2ae4df5b..150e345db6c 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -254,11 +254,11 @@ var/no_los var/turf/last_turf = origin_turf for(var/turf/target_turf in getline(origin_turf,neighbor)) - if(air_master.air_blocked(last_turf, target_turf)) + if(SSair.air_blocked(last_turf, target_turf)) no_los = 1 break last_turf = target_turf - if(!no_los && air_master.air_blocked(origin_turf, neighbor)) + if(!no_los && SSair.air_blocked(origin_turf, neighbor)) no_los = 1 if(no_los) closed_turfs |= neighbor diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 3bab28eae20..f679591e2d6 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -173,8 +173,8 @@ var/list/mining_overlay_cache = list() recalculate_directional_opacity() if(ticker && ticker.current_state == GAME_STATE_PLAYING) reconsider_lights() - if(air_master) - air_master.mark_for_update(src) + if(SSair) + SSair.mark_for_update(src) /turf/simulated/mineral/proc/get_cached_border(var/cache_id, var/direction, var/icon_file, var/icon_state, var/offset = 32) //Cache miss diff --git a/code/modules/mob/living/carbon/breathe.dm b/code/modules/mob/living/carbon/breathe.dm index f4d90e97120..009667dbf4b 100644 --- a/code/modules/mob/living/carbon/breathe.dm +++ b/code/modules/mob/living/carbon/breathe.dm @@ -2,7 +2,7 @@ //Start of a breath chain, calls breathe() /mob/living/carbon/handle_breathing() - if(air_master.current_cycle%4==2 || failed_last_breath || (health < CONFIG_GET(number/health_threshold_crit))) //First, resolve location and get a breath + if(SSair.current_cycle%4==2 || failed_last_breath || (health < CONFIG_GET(number/health_threshold_crit))) //First, resolve location and get a breath breathe() /mob/living/carbon/proc/breathe() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 7d64ac51cfe..7463a72cb94 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1777,7 +1777,7 @@ stomach_contents.Remove(M) qdel(M) continue - if(air_master.current_cycle%3==1) + if(SSair.current_cycle%3==1) if(!(M.status_flags & GODMODE)) M.adjustBruteLoss(5) adjust_nutrition(10) diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm index 6c573330d47..0baa98d422b 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm @@ -579,7 +579,7 @@ 'sound/vore/digest12.ogg') playsound(src, churnsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/preference/toggle/digestion_noises) //If the timing is right, and there are items to be touched - if(air_master.current_cycle%3==1 && length(touchable_items)) + if(SSair.current_cycle%3==1 && length(touchable_items)) //Burn all the mobs or add them to the exclusion list for(var/mob/living/T in (touchable_items)) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm index 763e7386ab5..f1c2ef76417 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm @@ -88,7 +88,7 @@ var/global/list/grub_machine_overlays = list() return if(istype(loc, /obj/machinery)) - if(machine_effect && air_master.current_cycle%30) + if(machine_effect && SSair.current_cycle%30) for(var/mob/M in player_list) M << machine_effect if(prob(10)) diff --git a/code/unit_tests/map_tests.dm b/code/unit_tests/map_tests.dm index e988835fc4d..d6a93477845 100644 --- a/code/unit_tests/map_tests.dm +++ b/code/unit_tests/map_tests.dm @@ -124,10 +124,10 @@ /datum/unit_test/active_edges/start_test() - var/active_edges = air_master.active_edges.len + var/active_edges = SSair.active_edges.len var/list/edge_log = list() if(active_edges) - for(var/connection_edge/E in air_master.active_edges) + for(var/connection_edge/E in SSair.active_edges) var/a_temp = E.A.air.temperature var/a_moles = E.A.air.total_moles var/a_vol = E.A.air.volume From 2bb91dcf59283cc439d5e2fc9bfd9a42fb64e2d3 Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Wed, 23 Oct 2024 05:48:57 -0700 Subject: [PATCH 2/4] Murder some old disabled admin verbs --- code/controllers/master_controller.dm | 2 - code/game/turfs/simulated.dm | 4 -- code/game/turfs/turf.dm | 3 - code/modules/admin/verbs/adminhelp.dm | 4 -- code/modules/admin/verbs/mapping.dm | 83 ------------------------- code/modules/admin/verbs/pray.dm | 4 -- code/modules/blob2/overmind/overmind.dm | 2 +- code/modules/client/verbs/ooc.dm | 7 --- code/modules/mentor/mentorhelp.dm | 4 -- code/modules/mob/living/say.dm | 2 +- code/modules/mob/say.dm | 7 --- code/modules/mob/say_vr.dm | 6 -- 12 files changed, 2 insertions(+), 126 deletions(-) diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 857ce225f62..2955d9d7213 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -11,8 +11,6 @@ var/global/datum/controller/game_controller/master_controller //Set in world.New var/global/controller_iteration = 0 var/global/last_tick_duration = 0 -var/global/pipe_processing_killed = 0 - /datum/controller/game_controller var/list/shuttle_list // For debugging and VV diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index 841ab7286ba..1a9611c8864 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -91,10 +91,6 @@ dirtoverlay.alpha = min((dirt - 50) * 5, 255) /turf/simulated/Entered(atom/A, atom/OL) - if(movement_disabled && usr.ckey != movement_disabled_exception) - to_chat(usr, span_danger("Movement is admin-disabled.")) //This is to identify lag problems - return - if (istype(A,/mob/living)) var/mob/living/M = A if(M.lying || M.flying) //VOREStation Edit diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 8751a723377..0b3b88a8d50 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -182,9 +182,6 @@ //There's a lot of QDELETED() calls here if someone can figure out how to optimize this but not runtime when something gets deleted by a Bump/CanPass/Cross call, lemme know or go ahead and fix this mess - kevinz000 /turf/Enter(atom/movable/mover, atom/oldloc) - if(movement_disabled && usr.ckey != movement_disabled_exception) - to_chat(usr, span_warning("Movement is admin-disabled.")) //This is to identify lag problems - return // Do not call ..() // Byond's default turf/Enter() doesn't have the behaviour we want with Bump() // By default byond will call Bump() on the first dense object in contents diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 6c3da08252c..a99414f7643 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -599,10 +599,6 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) set category = "Admin" set name = "Adminhelp" - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, span_danger("Speech is currently admin-disabled.")) - return - //handle muting and automuting if(prefs.muted & MUTE_ADMINHELP) to_chat(src, span_danger("Error: Admin-PM: You cannot send adminhelps (Muted).")) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 9b43a08bf4c..8ba2f059cbc 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -146,12 +146,6 @@ var/list/debug_verbs = list ( ,/client/proc/print_jobban_old ,/client/proc/print_jobban_old_filter ,/client/proc/forceEvent - ,/client/proc/break_all_air_groups - ,/client/proc/regroup_all_air_groups - ,/client/proc/kill_pipe_processing - ,/client/proc/kill_air_processing - ,/client/proc/disable_communication - ,/client/proc/disable_movement ,/client/proc/Zone_Info ,/client/proc/Test_ZAS_Connection ,/client/proc/ZoneTick @@ -345,80 +339,3 @@ var/list/debug_verbs = list ( to_world("There are [count] objects of type [type_path] in the game world") feedback_add_details("admin_verb","mOBJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -var/global/prevent_airgroup_regroup = 0 - -/client/proc/break_all_air_groups() - set category = "Mapping" - set name = "Break All Airgroups" - - /*prevent_airgroup_regroup = 1 - for(var/datum/air_group/AG in SSair.air_groups) - AG.suspend_group_processing() - message_admins("[src.ckey] used 'Break All Airgroups'")*/ - -/client/proc/regroup_all_air_groups() - set category = "Mapping" - set name = "Regroup All Airgroups Attempt" - - to_chat(usr, span_red("Proc disabled.")) //Why not.. Delete the procs instead? - - /*prevent_airgroup_regroup = 0 - for(var/datum/air_group/AG in SSair.air_groups) - AG.check_regroup() - message_admins("[src.ckey] used 'Regroup All Airgroups Attempt'")*/ - -/client/proc/kill_pipe_processing() - set category = "Mapping" - set name = "Kill pipe processing" - - to_chat(usr, span_red("Proc disabled.")) - - /*pipe_processing_killed = !pipe_processing_killed - if(pipe_processing_killed) - message_admins("[src.ckey] used 'kill pipe processing', stopping all pipe processing.") - else - message_admins("[src.ckey] used 'kill pipe processing', restoring all pipe processing.")*/ - -/client/proc/kill_air_processing() - set category = "Mapping" - set name = "Kill air processing" - - to_chat(usr, span_red("Proc disabled.")) - - /*air_processing_killed = !air_processing_killed - if(air_processing_killed) - message_admins("[src.ckey] used 'kill air processing', stopping all air processing.") - else - message_admins("[src.ckey] used 'kill air processing', restoring all air processing.")*/ - -//This proc is intended to detect lag problems relating to communication procs -var/global/say_disabled = 0 -/client/proc/disable_communication() - set category = "Mapping" - set name = "Disable all communication verbs" - - to_chat(usr, span_red("Proc disabled.")) - - /*say_disabled = !say_disabled - if(say_disabled) - message_admins("[src.ckey] used 'Disable all communication verbs', killing all communication methods.") - else - message_admins("[src.ckey] used 'Disable all communication verbs', restoring all communication methods.")*/ - -//This proc is intended to detect lag problems relating to movement -var/global/movement_disabled = 0 -var/global/movement_disabled_exception //This is the client that calls the proc, so he can continue to run around to gauge any change to lag. -/client/proc/disable_movement() - set category = "Mapping" - set name = "Disable all movement" - - to_chat(usr, span_red("Proc disabled.")) - - /*movement_disabled = !movement_disabled - if(movement_disabled) - message_admins("[src.ckey] used 'Disable all movement', killing all movement.") - movement_disabled_exception = usr.ckey - else - message_admins("[src.ckey] used 'Disable all movement', restoring all movement.")*/ diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index 9b056896a08..c81f313e0c3 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -2,10 +2,6 @@ set category = "IC" set name = "Pray" - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, span_red("Speech is currently admin-disabled.")) - return - var/raw_msg = sanitize(tgui_input_text(usr, "Prayers are sent to staff but do not open tickets or go to Discord. If you have a technical difficulty or an event/spice idea/hook - please ahelp instead. Thank you!", "Pray", null, MAX_MESSAGE_LEN)) if(!raw_msg) return diff --git a/code/modules/blob2/overmind/overmind.dm b/code/modules/blob2/overmind/overmind.dm index 993a4126ac1..73fe9978c5a 100644 --- a/code/modules/blob2/overmind/overmind.dm +++ b/code/modules/blob2/overmind/overmind.dm @@ -116,7 +116,7 @@ var/list/overminds = list() if(client) if(message) client.handle_spam_prevention(MUTE_IC) - if((client.prefs.muted & MUTE_IC) || say_disabled) + if((client.prefs.muted & MUTE_IC)) to_chat(src, span_warning("You cannot speak in IC (Muted).")) return diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 5e6d1b5f5da..561401ef92a 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -3,9 +3,6 @@ set name = "OOC" set category = "OOC" - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, span_warning("Speech is currently admin-disabled.")) - return if(!mob) return if(IsGuestKey(key)) @@ -86,10 +83,6 @@ set desc = "Local OOC, seen only by those in view." set category = "OOC" - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, span_danger("Speech is currently admin-disabled.")) - return - if(!mob) return diff --git a/code/modules/mentor/mentorhelp.dm b/code/modules/mentor/mentorhelp.dm index cbf457083ad..8ceb792e6b3 100644 --- a/code/modules/mentor/mentorhelp.dm +++ b/code/modules/mentor/mentorhelp.dm @@ -420,10 +420,6 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new) set category = "Admin" set name = "Mentorhelp" - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, span_danger("Speech is currently admin-disabled.")) - return - //handle muting and automuting if(prefs.muted & MUTE_ADMINHELP) to_chat(src, span_danger("Error: Mentor-PM: You cannot send adminhelps (Muted).")) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 94d1e093fca..6c81144e0ee 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -149,7 +149,7 @@ var/list/channel_to_radio_key = new if(client) if(message) client.handle_spam_prevention(MUTE_IC) - if((client.prefs.muted & MUTE_IC) || say_disabled) + if((client.prefs.muted & MUTE_IC)) to_chat(src, span_warning("You cannot speak in IC (Muted).")) return diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index a5b7a6f00d9..e2400e2c16b 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -32,9 +32,6 @@ set desc = "Emote to nearby people (and your pred/prey)" set hidden = 1 - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, span_red("Speech is currently admin-disabled.")) - return //VOREStation Addition Start if(forced_psay) pme(message) @@ -56,10 +53,6 @@ usr.emote(message) /mob/proc/say_dead(var/message) - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, span_danger("Speech is currently admin-disabled.")) - return - if(!client) return // Clientless mobs shouldn't be trying to talk in deadchat. diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 0ce22e0ec01..d2541b14b9b 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -8,9 +8,6 @@ set desc = "Emote to nearby people (and your pred/prey)" set hidden = 1 - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, "Speech is currently admin-disabled.") - return if(forced_psay) pme(message) return @@ -30,9 +27,6 @@ set category = "IC" set desc = "Emote to nearby people, with ability to choose which specific portion of people you wish to target." - if(say_disabled) //This is here to try to identify lag problems - to_chat(usr, "Speech is currently admin-disabled.") - return if(forced_psay) pme(message) return From 0bc3a47dbec67462558803c1e93bd5313727ba93 Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Wed, 23 Oct 2024 05:56:12 -0700 Subject: [PATCH 3/4] Move ZAS/Controller nonsense to air.dm properly --- code/ZAS/Controller.dm | 229 --------------------------- code/controllers/subsystems/air.dm | 240 ++++++++++++++++++++++++++++- vorestation.dme | 1 - 3 files changed, 237 insertions(+), 233 deletions(-) delete mode 100644 code/ZAS/Controller.dm diff --git a/code/ZAS/Controller.dm b/code/ZAS/Controller.dm deleted file mode 100644 index d3ada5e3116..00000000000 --- a/code/ZAS/Controller.dm +++ /dev/null @@ -1,229 +0,0 @@ -var/tick_multiplier = 2 - -/* - -Overview: - The air controller does everything. There are tons of procs in here. - -Class Vars: - zones - All zones currently holding one or more turfs. - edges - All processing edges. - - tiles_to_update - Tiles scheduled to update next tick. - zones_to_update - Zones which have had their air changed and need air archival. - active_hotspots - All processing fire objects. - - active_zones - The number of zones which were archived last tick. Used in debug verbs. - next_id - The next UID to be applied to a zone. Mostly useful for debugging purposes as zones do not need UIDs to function. - -Class Procs: - - mark_for_update(turf/T) - Adds the turf to the update list. When updated, update_air_properties() will be called. - When stuff changes that might affect airflow, call this. It's basically the only thing you need. - - add_zone(zone/Z) and remove_zone(zone/Z) - Adds zones to the zones list. Does not mark them for update. - - air_blocked(turf/A, turf/B) - Returns a bitflag consisting of: - AIR_BLOCKED - The connection between turfs is physically blocked. No air can pass. - ZONE_BLOCKED - There is a door between the turfs, so zones cannot cross. Air may or may not be permeable. - - has_valid_zone(turf/T) - Checks the presence and validity of T's zone. - May be called on unsimulated turfs, returning 0. - - merge(zone/A, zone/B) - Called when zones have a direct connection and equivalent pressure and temperature. - Merges the zones to create a single zone. - - connect(turf/simulated/A, turf/B) - Called by turf/update_air_properties(). The first argument must be simulated. - Creates a connection between A and B. - - mark_zone_update(zone/Z) - Adds zone to the update list. Unlike mark_for_update(), this one is called automatically whenever - air is returned from a simulated turf. - - equivalent_pressure(zone/A, zone/B) - Currently identical to A.air.compare(B.air). Returns 1 when directly connected zones are ready to be merged. - - get_edge(zone/A, zone/B) - get_edge(zone/A, turf/B) - Gets a valid connection_edge between A and B, creating a new one if necessary. - - has_same_air(turf/A, turf/B) - Used to determine if an unsimulated edge represents a specific turf. - Simulated edges use connection_edge/contains_zone() for the same purpose. - Returns 1 if A has identical gases and temperature to B. - - remove_edge(connection_edge/edge) - Called when an edge is erased. Removes it from processing. - -*/ - -// -// The rest of the air subsystem is defined in air.dm -// - -/datum/controller/subsystem/air - //Geometry lists - var/list/zones = list() - var/list/edges = list() - //Geometry updates lists - var/list/tiles_to_update = list() - var/list/zones_to_update = list() - var/list/active_fire_zones = list() - var/list/active_hotspots = list() - var/list/active_edges = list() - - var/active_zones = 0 - var/current_cycle = 0 - var/next_id = 1 //Used to keep track of zone UIDs. - -/datum/controller/subsystem/air/proc/add_zone(zone/z) - zones.Add(z) - z.name = "Zone [next_id++]" - mark_zone_update(z) - -/datum/controller/subsystem/air/proc/remove_zone(zone/z) - zones.Remove(z) - zones_to_update.Remove(z) - -/datum/controller/subsystem/air/proc/air_blocked(turf/A, turf/B) - #ifdef ZASDBG - ASSERT(isturf(A)) - ASSERT(isturf(B)) - #endif - var/ablock = A.c_airblock(B) - if(ablock == BLOCKED) return BLOCKED - return ablock | B.c_airblock(A) - -/datum/controller/subsystem/air/proc/has_valid_zone(turf/simulated/T) - #ifdef ZASDBG - ASSERT(istype(T)) - #endif - return istype(T) && T.zone && !T.zone.invalid - -/datum/controller/subsystem/air/proc/merge(zone/A, zone/B) - #ifdef ZASDBG - ASSERT(istype(A)) - ASSERT(istype(B)) - ASSERT(!A.invalid) - ASSERT(!B.invalid) - ASSERT(A != B) - #endif - if(A.contents.len < B.contents.len) - A.c_merge(B) - mark_zone_update(B) - else - B.c_merge(A) - mark_zone_update(A) - -/datum/controller/subsystem/air/proc/connect(turf/simulated/A, turf/simulated/B) - #ifdef ZASDBG - ASSERT(istype(A)) - ASSERT(isturf(B)) - ASSERT(A.zone) - ASSERT(!A.zone.invalid) - //ASSERT(B.zone) - ASSERT(A != B) - #endif - - var/block = SSair.air_blocked(A,B) - if(block & AIR_BLOCKED) return - - var/direct = !(block & ZONE_BLOCKED) - var/space = !istype(B) - - if(!space) - if(min(A.zone.contents.len, B.zone.contents.len) < ZONE_MIN_SIZE || (direct && (equivalent_pressure(A.zone,B.zone) || current_cycle == 0))) - merge(A.zone,B.zone) - return - - var/a_to_b = get_dir(A,B) - var/b_to_a = get_dir(B,A) - - if(!A.connections) A.connections = new - if(!B.connections) B.connections = new - - if(A.connections.get(a_to_b)) return - if(B.connections.get(b_to_a)) return - if(!space) - if(A.zone == B.zone) return - - - var/connection/c = new /connection(A,B) - - A.connections.place(c, a_to_b) - B.connections.place(c, b_to_a) - - if(direct) c.mark_direct() - -/datum/controller/subsystem/air/proc/mark_for_update(turf/T) - #ifdef ZASDBG - ASSERT(isturf(T)) - #endif - if(T.needs_air_update) return - tiles_to_update |= T - #ifdef ZASDBG - T.add_overlay(mark) - #endif - T.needs_air_update = 1 - -/datum/controller/subsystem/air/proc/mark_zone_update(zone/Z) - #ifdef ZASDBG - ASSERT(istype(Z)) - #endif - if(Z.needs_update) return - zones_to_update.Add(Z) - Z.needs_update = 1 - -/datum/controller/subsystem/air/proc/mark_edge_sleeping(connection_edge/E) - #ifdef ZASDBG - ASSERT(istype(E)) - #endif - if(E.sleeping) return - active_edges.Remove(E) - E.sleeping = 1 - -/datum/controller/subsystem/air/proc/mark_edge_active(connection_edge/E) - #ifdef ZASDBG - ASSERT(istype(E)) - #endif - if(!E.sleeping) return - active_edges.Add(E) - E.sleeping = 0 - -/datum/controller/subsystem/air/proc/equivalent_pressure(zone/A, zone/B) - return A.air.compare(B.air) - -/datum/controller/subsystem/air/proc/get_edge(zone/A, zone/B) - - if(istype(B)) - for(var/connection_edge/zone/edge in A.edges) - if(edge.contains_zone(B)) return edge - var/connection_edge/edge = new/connection_edge/zone(A,B) - edges.Add(edge) - edge.recheck() - return edge - else - for(var/connection_edge/unsimulated/edge in A.edges) - if(has_same_air(edge.B,B)) return edge - var/connection_edge/edge = new/connection_edge/unsimulated(A,B) - edges.Add(edge) - edge.recheck() - return edge - -/datum/controller/subsystem/air/proc/has_same_air(turf/A, turf/B) - if(A.oxygen != B.oxygen) return 0 - if(A.nitrogen != B.nitrogen) return 0 - if(A.phoron != B.phoron) return 0 - if(A.carbon_dioxide != B.carbon_dioxide) return 0 - if(A.temperature != B.temperature) return 0 - return 1 - -/datum/controller/subsystem/air/proc/remove_edge(connection_edge/E) - edges.Remove(E) - if(!E.sleeping) active_edges.Remove(E) diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index d84f591436f..91e67c0d2be 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -1,3 +1,64 @@ +/* +Overview: + SSair does everything. There are tons of procs in here. + +Class Vars: + zones - All zones currently holding one or more turfs. + edges - All processing edges. + + tiles_to_update - Tiles scheduled to update next tick. + zones_to_update - Zones which have had their air changed and need air archival. + active_hotspots - All processing fire objects. + + active_zones - The number of zones which were archived last tick. Used in debug verbs. + next_id - The next UID to be applied to a zone. Mostly useful for debugging purposes as zones do not need UIDs to function. + +Class Procs: + + mark_for_update(turf/T) + Adds the turf to the update list. When updated, update_air_properties() will be called. + When stuff changes that might affect airflow, call this. It's basically the only thing you need. + + add_zone(zone/Z) and remove_zone(zone/Z) + Adds zones to the zones list. Does not mark them for update. + + air_blocked(turf/A, turf/B) + Returns a bitflag consisting of: + AIR_BLOCKED - The connection between turfs is physically blocked. No air can pass. + ZONE_BLOCKED - There is a door between the turfs, so zones cannot cross. Air may or may not be permeable. + + has_valid_zone(turf/T) + Checks the presence and validity of T's zone. + May be called on unsimulated turfs, returning 0. + + merge(zone/A, zone/B) + Called when zones have a direct connection and equivalent pressure and temperature. + Merges the zones to create a single zone. + + connect(turf/simulated/A, turf/B) + Called by turf/update_air_properties(). The first argument must be simulated. + Creates a connection between A and B. + + mark_zone_update(zone/Z) + Adds zone to the update list. Unlike mark_for_update(), this one is called automatically whenever + air is returned from a simulated turf. + + equivalent_pressure(zone/A, zone/B) + Currently identical to A.air.compare(B.air). Returns 1 when directly connected zones are ready to be merged. + + get_edge(zone/A, zone/B) + get_edge(zone/A, turf/B) + Gets a valid connection_edge between A and B, creating a new one if necessary. + + has_same_air(turf/A, turf/B) + Used to determine if an unsimulated edge represents a specific turf. + Simulated edges use connection_edge/contains_zone() for the same purpose. + Returns 1 if A has identical gases and temperature to B. + + remove_edge(connection_edge/edge) + Called when an edge is erased. Removes it from processing. +*/ + // Air update stages #define SSAIR_TURFS 1 #define SSAIR_EDGES 2 @@ -30,6 +91,20 @@ SUBSYSTEM_DEF(air) // This is used to tell CI WHERE the edges are. var/list/startup_active_edge_log = list() + //Geometry lists + var/list/zones = list() + var/list/edges = list() + //Geometry updates lists + var/list/tiles_to_update = list() + var/list/zones_to_update = list() + var/list/active_fire_zones = list() + var/list/active_hotspots = list() + var/list/active_edges = list() + + var/active_zones = 0 + var/current_cycle = 0 + var/next_id = 1 //Used to keep track of zone UIDs. + /datum/controller/subsystem/air/Initialize(timeofday) report_progress("Processing Geometry...") @@ -302,9 +377,168 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun next_fire = world.time + wait can_fire = TRUE // Unpause -// -// The procs from the ZAS Air Controller are in ZAS/Controller.dm -// +/datum/controller/subsystem/air/proc/add_zone(zone/z) + zones.Add(z) + z.name = "Zone [next_id++]" + mark_zone_update(z) + +/datum/controller/subsystem/air/proc/remove_zone(zone/z) + zones.Remove(z) + zones_to_update.Remove(z) + +/datum/controller/subsystem/air/proc/air_blocked(turf/A, turf/B) + #ifdef ZASDBG + ASSERT(isturf(A)) + ASSERT(isturf(B)) + #endif + var/ablock = A.c_airblock(B) + if(ablock == BLOCKED) + return BLOCKED + return ablock | B.c_airblock(A) + +/datum/controller/subsystem/air/proc/has_valid_zone(turf/simulated/T) + #ifdef ZASDBG + ASSERT(istype(T)) + #endif + return istype(T) && T.zone && !T.zone.invalid + +/datum/controller/subsystem/air/proc/merge(zone/A, zone/B) + #ifdef ZASDBG + ASSERT(istype(A)) + ASSERT(istype(B)) + ASSERT(!A.invalid) + ASSERT(!B.invalid) + ASSERT(A != B) + #endif + if(A.contents.len < B.contents.len) + A.c_merge(B) + mark_zone_update(B) + else + B.c_merge(A) + mark_zone_update(A) + +/datum/controller/subsystem/air/proc/connect(turf/simulated/A, turf/simulated/B) + #ifdef ZASDBG + ASSERT(istype(A)) + ASSERT(isturf(B)) + ASSERT(A.zone) + ASSERT(!A.zone.invalid) + //ASSERT(B.zone) + ASSERT(A != B) + #endif + + var/block = SSair.air_blocked(A,B) + if(block & AIR_BLOCKED) return + + var/direct = !(block & ZONE_BLOCKED) + var/space = !istype(B) + + if(!space) + if(min(A.zone.contents.len, B.zone.contents.len) < ZONE_MIN_SIZE || (direct && (equivalent_pressure(A.zone,B.zone) || current_cycle == 0))) + merge(A.zone,B.zone) + return + + var/a_to_b = get_dir(A,B) + var/b_to_a = get_dir(B,A) + + if(!A.connections) + A.connections = new + if(!B.connections) + B.connections = new + + if(A.connections.get(a_to_b)) + return + if(B.connections.get(b_to_a)) + return + if(!space) + if(A.zone == B.zone) + return + + + var/connection/c = new /connection(A,B) + + A.connections.place(c, a_to_b) + B.connections.place(c, b_to_a) + + if(direct) c.mark_direct() + +/datum/controller/subsystem/air/proc/mark_for_update(turf/T) + #ifdef ZASDBG + ASSERT(isturf(T)) + #endif + if(T.needs_air_update) + return + tiles_to_update |= T + #ifdef ZASDBG + T.add_overlay(mark) + #endif + T.needs_air_update = 1 + +/datum/controller/subsystem/air/proc/mark_zone_update(zone/Z) + #ifdef ZASDBG + ASSERT(istype(Z)) + #endif + if(Z.needs_update) + return + zones_to_update.Add(Z) + Z.needs_update = 1 + +/datum/controller/subsystem/air/proc/mark_edge_sleeping(connection_edge/E) + #ifdef ZASDBG + ASSERT(istype(E)) + #endif + if(E.sleeping) + return + active_edges.Remove(E) + E.sleeping = 1 + +/datum/controller/subsystem/air/proc/mark_edge_active(connection_edge/E) + #ifdef ZASDBG + ASSERT(istype(E)) + #endif + if(!E.sleeping) + return + active_edges.Add(E) + E.sleeping = 0 + +/datum/controller/subsystem/air/proc/equivalent_pressure(zone/A, zone/B) + return A.air.compare(B.air) + +/datum/controller/subsystem/air/proc/get_edge(zone/A, zone/B) + if(istype(B)) + for(var/connection_edge/zone/edge in A.edges) + if(edge.contains_zone(B)) + return edge + var/connection_edge/edge = new /connection_edge/zone(A,B) + edges.Add(edge) + edge.recheck() + return edge + else + for(var/connection_edge/unsimulated/edge in A.edges) + if(has_same_air(edge.B,B)) + return edge + var/connection_edge/edge = new /connection_edge/unsimulated(A,B) + edges.Add(edge) + edge.recheck() + return edge + +/datum/controller/subsystem/air/proc/has_same_air(turf/A, turf/B) + if(A.oxygen != B.oxygen) + return FALSE + if(A.nitrogen != B.nitrogen) + return FALSE + if(A.phoron != B.phoron) + return FALSE + if(A.carbon_dioxide != B.carbon_dioxide) + return FALSE + if(A.temperature != B.temperature) + return FALSE + return TRUE + +/datum/controller/subsystem/air/proc/remove_edge(connection_edge/E) + edges.Remove(E) + if(!E.sleeping) + active_edges.Remove(E) #undef SSAIR_TURFS #undef SSAIR_EDGES diff --git a/vorestation.dme b/vorestation.dme index b11104cc702..97227e00887 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -4360,7 +4360,6 @@ #include "code\ZAS\Connection.dm" #include "code\ZAS\ConnectionGroup.dm" #include "code\ZAS\ConnectionManager.dm" -#include "code\ZAS\Controller.dm" #include "code\ZAS\Debug.dm" #include "code\ZAS\Diagnostic.dm" #include "code\ZAS\Fire.dm" From 53864d01910439514e36cacd332ed150be0aa7f9 Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Wed, 23 Oct 2024 07:03:47 -0700 Subject: [PATCH 4/4] Inline SSair.has_valid_zone --- code/ZAS/Connection.dm | 4 ++-- code/ZAS/Turf.dm | 7 +++---- code/ZAS/Zone.dm | 2 +- code/__defines/ZAS.dm | 2 ++ code/controllers/subsystems/air.dm | 10 ---------- code/game/turfs/turf_changing.dm | 8 +++++++- 6 files changed, 15 insertions(+), 18 deletions(-) diff --git a/code/ZAS/Connection.dm b/code/ZAS/Connection.dm index e0549366cbc..688eb129922 100644 --- a/code/ZAS/Connection.dm +++ b/code/ZAS/Connection.dm @@ -60,8 +60,8 @@ Class Procs: /connection/New(turf/simulated/A, turf/simulated/B) #ifdef ZASDBG - ASSERT(SSair.has_valid_zone(A)) - //ASSERT(SSair.has_valid_zone(B)) + ASSERT(HAS_VALID_ZONE(A)) + //ASSERT(HAS_VALID_ZONE(B)) #endif src.A = A src.B = B diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm index f8bfc5ae83c..a67970c63aa 100644 --- a/code/ZAS/Turf.dm +++ b/code/ZAS/Turf.dm @@ -41,8 +41,7 @@ if(istype(unsim, /turf/simulated)) var/turf/simulated/sim = unsim - if(SSair.has_valid_zone(sim)) - + if(HAS_VALID_ZONE(sim)) SSair.connect(sim, src) /* @@ -162,7 +161,7 @@ var/turf/simulated/sim = unsim sim.open_directions |= reverse_dir[d] - if(SSair.has_valid_zone(sim)) + if(HAS_VALID_ZONE(sim)) //Might have assigned a zone, since this happens for each direction. if(!zone) @@ -210,7 +209,7 @@ if(!postponed) postponed = list() postponed.Add(unsim) - if(!SSair.has_valid_zone(src)) //Still no zone, make a new one. + if(!HAS_VALID_ZONE(src)) //Still no zone, make a new one. var/zone/newzone = new/zone() newzone.add(src) diff --git a/code/ZAS/Zone.dm b/code/ZAS/Zone.dm index db686ce8f05..b6d012afe7d 100644 --- a/code/ZAS/Zone.dm +++ b/code/ZAS/Zone.dm @@ -65,7 +65,7 @@ Class Procs: #ifdef ZASDBG ASSERT(!invalid) ASSERT(istype(T)) - ASSERT(!SSair.has_valid_zone(T)) + ASSERT(!HAS_VALID_ZONE(T)) #endif var/datum/gas_mixture/turf_air = T.return_air() diff --git a/code/__defines/ZAS.dm b/code/__defines/ZAS.dm index ba2b4b73e76..c8289fdc271 100644 --- a/code/__defines/ZAS.dm +++ b/code/__defines/ZAS.dm @@ -11,3 +11,5 @@ #define ATMOS_PASS_NO 2 // Never blocks air or zones. #define ATMOS_PASS_DENSITY 3 // Blocks air and zones if density = TRUE, allows both if density = FALSE #define ATMOS_PASS_PROC 4 // Call CanZASPass() using c_airblock + +#define HAS_VALID_ZONE(T) (T.zone && !T.zone.invalid) diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index 91e67c0d2be..e008086d04b 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -27,10 +27,6 @@ Class Procs: AIR_BLOCKED - The connection between turfs is physically blocked. No air can pass. ZONE_BLOCKED - There is a door between the turfs, so zones cannot cross. Air may or may not be permeable. - has_valid_zone(turf/T) - Checks the presence and validity of T's zone. - May be called on unsimulated turfs, returning 0. - merge(zone/A, zone/B) Called when zones have a direct connection and equivalent pressure and temperature. Merges the zones to create a single zone. @@ -396,12 +392,6 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun return BLOCKED return ablock | B.c_airblock(A) -/datum/controller/subsystem/air/proc/has_valid_zone(turf/simulated/T) - #ifdef ZASDBG - ASSERT(istype(T)) - #endif - return istype(T) && T.zone && !T.zone.invalid - /datum/controller/subsystem/air/proc/merge(zone/A, zone/B) #ifdef ZASDBG ASSERT(istype(A)) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 11afc9e0420..54027edb899 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -21,6 +21,11 @@ if(istype(below)) below.update_icon() // To add or remove the 'ceiling-less' overlay. +/proc/has_valid_ZAS_zone(turf/simulated/T) + if(!istype(T)) + return FALSE + return HAS_VALID_ZONE(T) + //Creates a new turf /turf/proc/ChangeTurf(var/turf/N, var/tell_universe=1, var/force_lighting_update = 0, var/preserve_outdoors = FALSE) if (!N) @@ -28,7 +33,8 @@ if(N == /turf/space) var/turf/below = GetBelow(src) - if(istype(below) && (SSair.has_valid_zone(below) || SSair.has_valid_zone(src)) && !(src.z in using_map.below_blocked_levels) && (!istype(below, /turf/unsimulated/wall) && !istype(below, /turf/simulated/sky))) // VOREStation Edit: Weird open space + var/zones_present = has_valid_ZAS_zone(below) || has_valid_ZAS_zone(src) + if(istype(below) && zones_present && !(src.z in using_map.below_blocked_levels) && (!istype(below, /turf/unsimulated/wall) && !istype(below, /turf/simulated/sky))) // VOREStation Edit: Weird open space N = /turf/simulated/open var/obj/fire/old_fire = fire