modules/atmospherics major cleanup (#61904)

major cleanup of modules/atmospherics folder and all related files, still many missing
-cleanup of procs name
-cleanup of vars name
-documentation of some of the procs
-minor changes to some for() logic (no in game changes just early continue or as anything checks)

No in game changes, only code and docs
This commit is contained in:
Ghilker
2021-10-14 10:13:57 +02:00
committed by GitHub
parent c4b60fda30
commit cb5fb1df2d
96 changed files with 3783 additions and 3726 deletions
+7 -7
View File
@@ -469,7 +469,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if (S.dir == ALL_CARDINALS)
to_chat(user, span_warning("\The [S] has no unconnected directions!"))
return
var/old_init_dir = S.GetInitDirections()
var/old_init_dir = S.get_init_directions()
if (old_init_dir == p_init_dir)
to_chat(user, span_warning("\The [S] is already in this configuration!"))
return
@@ -492,7 +492,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
to_chat(user, span_warning("\The [src]'s screen flashes a warning: Can't configure a pipe in a currently connected direction."))
return
// Grab the current initializable directions, which may differ from old_init_dir if someone else was working on the same pipe at the same time
var/current_init_dir = S.GetInitDirections()
var/current_init_dir = S.get_init_directions()
// Access p_init_dir directly. The RPD can change target layer and initializable directions (though not pipe type or dir) while working to dispense and connect a component,
// and have it reflected in the final result. Reprogramming should be similarly consistent.
var/new_init_dir = (current_init_dir & ~target_differences) | (p_init_dir & target_differences)
@@ -500,7 +500,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if (ISSTUB(new_init_dir))
to_chat(user, span_warning("\The [src]'s screen flashes a warning: Can't configure a pipe to only connect in one direction."))
return
S.SetInitDirections(new_init_dir)
S.set_init_directions(new_init_dir)
// We're now reconfigured.
// We can never disconnect from existing connections, but we can connect to previously unconnected directions, and should immediately do so
var/newly_permitted_connections = new_init_dir & ~current_init_dir
@@ -516,11 +516,11 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
node.disconnect(S)
S.nodes[i] = null
// Get our new connections
S.atmosinit()
S.atmos_init()
// Connect to our new connections
for (var/obj/machinery/atmospherics/O in S.nodes)
O.atmosinit()
O.addMember(src)
O.atmos_init()
O.add_member(src)
SSair.add_to_rebuild_queue(S)
// Finally, update our internal state - update_pipe_icon also updates dir and connections
S.update_pipe_icon()
@@ -573,7 +573,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
pipe_type.update()
pipe_type.add_fingerprint(usr)
pipe_type.setPipingLayer(piping_layer)
pipe_type.set_piping_layer(piping_layer)
if(ispath(queued_p_type, /obj/machinery/atmospherics) && !ispath(queued_p_type, /obj/machinery/atmospherics/pipe/color_adapter))
pipe_type.add_atom_colour(GLOB.pipe_paint_colors[paint_color], FIXED_COLOUR_PRIORITY)
if(mode & WRENCH_MODE)
@@ -56,7 +56,7 @@
force_proj_busy = FALSE
return
force_proj_busy = FALSE
playsound(src,'sound/weapons/resonator_fire.ogg',50,TRUE)
user.visible_message(span_warning("[user] projects a forcefield!"),span_notice("You project a forcefield."))
var/obj/structure/projected_forcefield/F = new(T, src)
@@ -102,7 +102,7 @@
density = TRUE
mouse_opacity = MOUSE_OPACITY_OPAQUE
resistance_flags = INDESTRUCTIBLE
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
armor = list(MELEE = 0, BULLET = 25, LASER = 50, ENERGY = 50, BOMB = 25, BIO = 100, RAD = 100, FIRE = 100, ACID = 100)
var/obj/item/forcefield_projector/generator
+1 -1
View File
@@ -197,7 +197,7 @@
for(var/turf/T in turflist)
if(T == previousturf)
continue //so we don't burn the tile we be standin on
var/list/turfs_sharing_with_prev = previousturf.GetAtmosAdjacentTurfs(alldir=1)
var/list/turfs_sharing_with_prev = previousturf.get_atmos_adjacent_turfs(alldir=1)
if(!(T in turfs_sharing_with_prev))
break
if(igniter)