mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
Removes some boiler plate from working with atmos code (#58885)
Everything that called turf.assume_air and turf.remove_air was already updating turfs, and all that not tying the two together did was add more boiler plate, and break things when people forgot about it. This shouldn't add any overhead outside of hotspots, but I think that's trivial
This commit is contained in:
@@ -91,7 +91,7 @@
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/env = L.return_air() //get air from the turf
|
||||
var/datum/gas_mixture/removed = env.remove(0.1 * env.total_moles())
|
||||
var/datum/gas_mixture/removed = env.remove_ratio(0.1)
|
||||
|
||||
if(!removed)
|
||||
return
|
||||
|
||||
@@ -224,7 +224,6 @@
|
||||
//Burn it based on transfered gas
|
||||
target.hotspot_expose((tank_mix.temperature*2) + 380,500)
|
||||
//location.hotspot_expose(1000,500,1)
|
||||
SSair.add_to_active(target)
|
||||
|
||||
/obj/item/flamethrower/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
if(!T)
|
||||
return
|
||||
T.assume_air(gasused)
|
||||
T.air_update_turf(FALSE, FALSE)
|
||||
if(!gasused)
|
||||
to_chat(user, "<span class='warning'>\The [src]'s tank is empty!</span>")
|
||||
target.apply_damage((force / 5), BRUTE)
|
||||
|
||||
@@ -131,7 +131,6 @@
|
||||
var/atom/location = loc
|
||||
if(location)
|
||||
location.assume_air(air_contents)
|
||||
location.air_update_turf(FALSE, FALSE)
|
||||
playsound(location, 'sound/effects/spray.ogg', 10, TRUE, -3)
|
||||
return ..()
|
||||
|
||||
@@ -267,7 +266,6 @@
|
||||
return
|
||||
var/datum/gas_mixture/leaked_gas = air_contents.remove_ratio(0.25)
|
||||
location.assume_air(leaked_gas)
|
||||
location.air_update_turf(FALSE, FALSE)
|
||||
|
||||
/**
|
||||
* Handles the minimum and maximum pressure tolerances of the tank.
|
||||
|
||||
@@ -200,8 +200,6 @@
|
||||
ground_zero.assume_air(bomb_mixture)
|
||||
ground_zero.hotspot_expose(1000, 125)
|
||||
|
||||
ground_zero.air_update_turf(FALSE, FALSE)
|
||||
|
||||
/obj/item/tank/proc/release() //This happens when the bomb is not welded. Tank contents are just spat out.
|
||||
var/datum/gas_mixture/our_mix = return_air()
|
||||
var/datum/gas_mixture/removed = remove_air(our_mix.total_moles())
|
||||
@@ -209,7 +207,6 @@
|
||||
if(!T)
|
||||
return
|
||||
T.assume_air(removed)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
|
||||
/obj/item/onetankbomb/return_analyzable_air()
|
||||
if(bombtank)
|
||||
|
||||
@@ -63,12 +63,14 @@
|
||||
return FALSE
|
||||
air.merge(giver)
|
||||
update_visuals()
|
||||
air_update_turf(FALSE, FALSE)
|
||||
return TRUE
|
||||
|
||||
/turf/open/remove_air(amount)
|
||||
var/datum/gas_mixture/ours = return_air()
|
||||
var/datum/gas_mixture/removed = ours.remove(amount)
|
||||
update_visuals()
|
||||
air_update_turf(FALSE, FALSE)
|
||||
return removed
|
||||
|
||||
/turf/open/proc/copy_air_with_tile(turf/open/T)
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
return
|
||||
|
||||
loc.assume_air(removed)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
|
||||
var/datum/pipeline/parent1 = parents[1]
|
||||
parent1.update = TRUE
|
||||
@@ -107,7 +106,6 @@
|
||||
return
|
||||
|
||||
air2.merge(removed)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
|
||||
var/datum/pipeline/parent2 = parents[2]
|
||||
parent2.update = TRUE
|
||||
|
||||
@@ -383,7 +383,6 @@
|
||||
loc.assume_air(main_port.remove_ratio(1))
|
||||
if(thermal_exchange_port)
|
||||
loc.assume_air(thermal_exchange_port.remove_ratio(1))
|
||||
air_update_turf(FALSE, FALSE)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/thermomachine/ui_status(mob/user)
|
||||
|
||||
@@ -83,7 +83,6 @@
|
||||
if(istype(T))
|
||||
var/datum/gas_mixture/leaked = removed.remove_ratio(VOLUME_PUMP_LEAK_AMOUNT)
|
||||
T.assume_air(leaked)
|
||||
T.air_update_turf(FALSE, FALSE)
|
||||
|
||||
air2.merge(removed)
|
||||
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
continue
|
||||
to_release.merge(air.remove(shared_loss))
|
||||
T.assume_air(to_release)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
|
||||
// Helpers
|
||||
|
||||
|
||||
@@ -325,7 +325,6 @@
|
||||
remove = remove_fusion.remove_ratio(0.1)
|
||||
var/turf/local = pick(around_turfs)
|
||||
local.assume_air(remove)
|
||||
local.air_update_turf(FALSE, FALSE)
|
||||
loc.assume_air(internal_fusion)
|
||||
var/datum/gas_mixture/remove_moderator
|
||||
if(moderator_internal.total_moles() > 0)
|
||||
@@ -335,7 +334,5 @@
|
||||
remove = remove_moderator.remove_ratio(0.1)
|
||||
var/turf/local = pick(around_turfs)
|
||||
local.assume_air(remove)
|
||||
local.air_update_turf(FALSE, FALSE)
|
||||
loc.assume_air(moderator_internal)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
qdel(src)
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
if(bluespace_network.total_moles())
|
||||
var/turf/local_turf = get_turf(src)
|
||||
local_turf.assume_air(bluespace_network)
|
||||
local_turf.air_update_turf(FALSE, FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/bluespace_sender/update_icon_state()
|
||||
|
||||
@@ -153,12 +153,9 @@
|
||||
///Take the turf the cryotube is on
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
///Take the air composition of the turf
|
||||
var/datum/gas_mixture/env = T.return_air()
|
||||
///Take the air composition inside the cryotube
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
env.merge(air1)
|
||||
T.air_update_turf(FALSE, FALSE)
|
||||
T.assume_air(air1)
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
location.assume_air(removed)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
|
||||
update_parents()
|
||||
|
||||
|
||||
@@ -118,7 +118,6 @@
|
||||
return
|
||||
|
||||
loc.assume_air(removed)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
update_parents()
|
||||
|
||||
else // external -> internal
|
||||
@@ -137,7 +136,6 @@
|
||||
return
|
||||
|
||||
air_contents.merge(removed)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
update_parents()
|
||||
|
||||
//Radio remote control
|
||||
|
||||
@@ -190,7 +190,6 @@
|
||||
//Remix the resulting gases
|
||||
air_contents.merge(filtered_out)
|
||||
tile.assume_air(removed)
|
||||
tile.air_update_turf(FALSE, FALSE)
|
||||
update_parents()
|
||||
|
||||
else //Just siphoning all air
|
||||
@@ -200,7 +199,6 @@
|
||||
var/datum/gas_mixture/removed = tile.remove_air(transfer_moles)
|
||||
|
||||
air_contents.merge(removed)
|
||||
tile.air_update_turf(FALSE, FALSE)
|
||||
update_parents()
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -138,7 +138,6 @@
|
||||
merger.gases[spawn_id][MOLES] = spawn_mol * delta_time
|
||||
merger.temperature = spawn_temp
|
||||
O.assume_air(merger)
|
||||
O.air_update_turf(FALSE, FALSE)
|
||||
|
||||
/obj/machinery/atmospherics/miner/attack_ai(mob/living/silicon/user)
|
||||
if(broken)
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
if(air_temporary)
|
||||
var/turf/T = loc
|
||||
T.assume_air(air_temporary)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/return_air()
|
||||
if(air_temporary)
|
||||
|
||||
@@ -521,7 +521,7 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister())
|
||||
var/expelled_pressure = expelled_gas?.return_pressure()
|
||||
var/turf/T = get_turf(src)
|
||||
T.assume_air(expelled_gas)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
|
||||
obj_break()
|
||||
|
||||
if(expelled_pressure > pressure_limit)
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
//This explosion will destroy the can, release its air.
|
||||
var/turf/T = get_turf(src)
|
||||
T.assume_air(air_contents)
|
||||
T.air_update_turf(FALSE, FALSE)
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
/obj/machinery/portable_atmospherics/pump/Destroy()
|
||||
var/turf/T = get_turf(src)
|
||||
T.assume_air(air_contents)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/update_icon_state()
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
/obj/machinery/portable_atmospherics/scrubber/Destroy()
|
||||
var/turf/T = get_turf(src)
|
||||
T.assume_air(air_contents)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/update_icon_state()
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
stank.gases[/datum/gas/miasma][MOLES] = (yield + 6)*3.5*MIASMA_CORPSE_MOLES*delta_time // this process is only being called about 2/7 as much as corpses so this is 12-32 times a corpses
|
||||
stank.temperature = T20C // without this the room would eventually freeze and miasma mining would be easier
|
||||
T.assume_air(stank)
|
||||
T.air_update_turf(FALSE, FALSE)
|
||||
|
||||
//Galaxy Thistle
|
||||
/obj/item/seeds/galaxythistle
|
||||
|
||||
@@ -125,7 +125,6 @@
|
||||
|
||||
if(breath)
|
||||
loc.assume_air(breath)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
|
||||
/mob/living/carbon/proc/has_smoke_protection()
|
||||
if(HAS_TRAIT(src, TRAIT_NOBREATH))
|
||||
|
||||
@@ -132,7 +132,6 @@
|
||||
// called to vent all gas in holder to a location
|
||||
/obj/structure/disposalholder/proc/vent_gas(turf/T)
|
||||
T.assume_air(gas)
|
||||
T.air_update_turf(FALSE, FALSE)
|
||||
|
||||
/obj/structure/disposalholder/AllowDrop()
|
||||
return TRUE
|
||||
|
||||
@@ -242,7 +242,6 @@
|
||||
|
||||
/obj/vehicle/sealed/mecha/obj_destruction()
|
||||
loc.assume_air(cabin_air)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
for(var/mob/living/occupant as anything in occupants)
|
||||
if(isAI(occupant))
|
||||
occupant.gib() //No wreck, no AI to recover
|
||||
@@ -399,7 +398,6 @@
|
||||
var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(DT_PROB_RATE(0.05, delta_time))
|
||||
if(loc)
|
||||
loc.assume_air(leaked_gas)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
else
|
||||
qdel(leaked_gas)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user