From 23f6f5e90b97d1dd56d8084a55785d37b63fa641 Mon Sep 17 00:00:00 2001 From: Katherine Kiefer Date: Tue, 21 Jun 2022 08:16:36 +1000 Subject: [PATCH] fix this shit --- .../structures/crates_lockers/closets/bodybag.dm | 4 ++-- .../atmospherics/environmental/LINDA_system.dm | 14 +++++++++++--- code/modules/atmospherics/gasmixtures/reactions.dm | 10 +++++----- .../components/gas_recipe_machines/crystallizer.dm | 3 +-- .../mob/living/simple_animal/hostile/regalrat.dm | 4 ++-- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/code/game/objects/structures/crates_lockers/closets/bodybag.dm b/code/game/objects/structures/crates_lockers/closets/bodybag.dm index 7272d01316bc..1ef2f8932abb 100644 --- a/code/game/objects/structures/crates_lockers/closets/bodybag.dm +++ b/code/game/objects/structures/crates_lockers/closets/bodybag.dm @@ -303,8 +303,8 @@ air_contents = null air_contents = new(50) //liters air_contents.set_temperature(T20C) - air_contents.set_moles(/datum/gas/oxygen, (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD) - air_contents.set_moles(/datum/gas/nitrous_oxide, (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD) + air_contents.set_moles(GAS_O2, (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD) + air_contents.set_moles(GAS_NITROUS, (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD) /obj/structure/closet/body_bag/environmental/prisoner/syndicate/Destroy() if(air_contents) diff --git a/code/modules/atmospherics/environmental/LINDA_system.dm b/code/modules/atmospherics/environmental/LINDA_system.dm index c4fa7ae33612..0bff174c1dad 100644 --- a/code/modules/atmospherics/environmental/LINDA_system.dm +++ b/code/modules/atmospherics/environmental/LINDA_system.dm @@ -46,12 +46,20 @@ var/turf/T = get_step_multiz(src, direction) if(!istype(T)) continue - var/opp_dir = REVERSE_DIR(direction) + + var/src_contains_firelock = 1 + if(locate(/obj/machinery/door/firedoor) in src) + src_contains_firelock |= 2 + + var/other_contains_firelock = 1 + if(locate(/obj/machinery/door/firedoor) in T) + other_contains_firelock |= 2 + 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] = other_contains_firelock + T.atmos_adjacent_turfs[src] = src_contains_firelock else if (atmos_adjacent_turfs) atmos_adjacent_turfs -= T diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index 23c550a7a335..954fc5ef8c44 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -240,19 +240,19 @@ nobliumformation = 1001 /datum/gas_reaction/n2odecomp/init_reqs() min_requirements = list( "TEMP" = N2O_DECOMPOSITION_MIN_HEAT, - /datum/gas/nitrous_oxide = MINIMUM_MOLE_COUNT*2 + GAS_NITROUS = MINIMUM_MOLE_COUNT*2 ) /datum/gas_reaction/n2odecomp/react(datum/gas_mixture/air, datum/holder) var/old_heat_capacity = air.heat_capacity() var/temperature = air.return_temperature() - var/nitrous = air.get_moles(/datum/gas/nitrous_oxide) + var/nitrous = air.get_moles(GAS_NITROUS) var/burned_fuel = min(N2O_DECOMPOSITION_RATE*nitrous*temperature*(temperature-N2O_DECOMPOSITION_MAX_HEAT)/((-1/4)*(N2O_DECOMPOSITION_MAX_HEAT**2)), nitrous) if(burned_fuel>0) - air.set_moles(/datum/gas/nitrous_oxide, QUANTIZE(nitrous - burned_fuel)) - air.set_moles(/datum/gas/nitrogen, QUANTIZE(air.get_moles(/datum/gas/nitrogen) + burned_fuel)) - air.set_moles(/datum/gas/oxygen, QUANTIZE(air.get_moles(/datum/gas/oxygen) + burned_fuel/2)) + air.set_moles(GAS_NITROUS, QUANTIZE(nitrous - burned_fuel)) + air.set_moles(GAS_N2, QUANTIZE(air.get_moles(GAS_N2) + burned_fuel)) + air.set_moles(GAS_O2, QUANTIZE(air.get_moles(GAS_O2) + burned_fuel/2)) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) air.set_temperature((temperature*old_heat_capacity + burned_fuel*N2O_DECOMPOSITION_ENERGY)/new_heat_capacity) diff --git a/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm b/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm index d8ba54cab25b..d53d56c4af31 100644 --- a/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm +++ b/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm @@ -299,9 +299,8 @@ else requirements = list("To create [selected_recipe.name] you will need:") for(var/gas_type in selected_recipe.requirements) - var/datum/gas/gas_required = gas_type var/amount_consumed = selected_recipe.requirements[gas_type] - requirements += "-[amount_consumed] moles of [initial(gas_required.name)]" + requirements += "-[amount_consumed] moles of [initial(gas_type)]" requirements += "In a temperature range between [selected_recipe.min_temp] K and [selected_recipe.max_temp] K" requirements += "The crystallization reaction will be [selected_recipe.reaction_type]" data["requirements"] = requirements.Join("\n") diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index ac2f67960266..93797b56d48a 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -79,9 +79,9 @@ /mob/living/simple_animal/hostile/regalrat/handle_environment(datum/gas_mixture/environment) . = ..() - if(stat == DEAD || !environment || !environment.get_moles(/datum/gas/miasma)) + if(stat == DEAD || !environment || !environment.get_moles(GAS_MIASMA)) return - var/miasma_percentage = environment.get_moles(/datum/gas/miasma)/environment.total_moles() + var/miasma_percentage = environment.get_moles(GAS_MIASMA)/environment.total_moles() if(miasma_percentage>=0.25) heal_bodypart_damage(1)