mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 11:34:19 +01:00
This reverts commit c0acf193a0.
This commit is contained in:
@@ -111,9 +111,6 @@
|
||||
/proc/create_hotspot(turf/T, hotspot_temperature, hotspot_volume)
|
||||
return RUSTLIB_CALL(milla_create_hotspot, T, hotspot_temperature, hotspot_volume)
|
||||
|
||||
/proc/extinguish_hotspot(turf/T)
|
||||
RUSTLIB_CALL(milla_extinguish_hotspot, T)
|
||||
|
||||
/proc/track_pressure_tiles(atom/A, radius)
|
||||
var/turf/T = get_turf(A)
|
||||
if(istype(T))
|
||||
|
||||
@@ -75,16 +75,15 @@
|
||||
if(!found)
|
||||
return
|
||||
|
||||
var/datum/milla_safe/quench/milla = new()
|
||||
var/datum/milla_safe/turf_cool/milla = new()
|
||||
milla.invoke_async(src, delta, divisor)
|
||||
|
||||
/datum/milla_safe/quench
|
||||
/datum/milla_safe/turf_cool
|
||||
|
||||
/datum/milla_safe/quench/on_run(turf/T, delta, divisor)
|
||||
/datum/milla_safe/turf_cool/on_run(turf/T, delta, divisor)
|
||||
var/datum/gas_mixture/air = get_turf_air(T)
|
||||
air.set_temperature(max(min(air.temperature()-delta * divisor,air.temperature() / divisor), TCMB))
|
||||
air.react()
|
||||
extinguish_hotspot(T)
|
||||
|
||||
/*
|
||||
* Makes a turf slippery using the given parameters
|
||||
|
||||
@@ -594,49 +594,6 @@ pub(crate) fn internal_create_hotspot(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// BYOND API for a heat source creating a hotspot on a tile.
|
||||
#[byondapi::bind]
|
||||
fn milla_extinguish_hotspot(
|
||||
turf: ByondValue,
|
||||
) -> eyre::Result<ByondValue> {
|
||||
logging::setup_panic_handler();
|
||||
let (x, y, z) = byond_xyz(&turf)?.coordinates();
|
||||
|
||||
internal_extinguish_hotspot(
|
||||
x as i32 - 1,
|
||||
y as i32 - 1,
|
||||
z as i32 - 1,
|
||||
)?;
|
||||
Ok(ByondValue::null())
|
||||
}
|
||||
|
||||
/// Rust version of a heat source creating a hotspot.
|
||||
pub(crate) fn internal_extinguish_hotspot(
|
||||
x: i32,
|
||||
y: i32,
|
||||
z: i32,
|
||||
) -> Result<()> {
|
||||
let buffers = BUFFERS.get().ok_or(eyre!("BUFFERS not initialized."))?;
|
||||
let active = buffers.get_active().read().unwrap();
|
||||
let maybe_z_level = active.0[z as usize].try_write();
|
||||
if maybe_z_level.is_err() {
|
||||
return Err(eyre!(
|
||||
"Tried to write during asynchronous, read-only atmos. Use a /datum/milla_safe/..."
|
||||
));
|
||||
}
|
||||
let mut z_level = maybe_z_level.unwrap();
|
||||
let tile = z_level.get_tile_mut(ZLevel::maybe_get_index(x, y).ok_or(eyre!(
|
||||
"Bad coordinates ({}, {}, {})",
|
||||
x + 1,
|
||||
y + 1,
|
||||
z + 1
|
||||
))?);
|
||||
|
||||
tile.hotspot_temperature = 0.0;
|
||||
tile.hotspot_volume = 0.0;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// BYOND API for tracking the pressure of all nearby tiles next tick.
|
||||
#[byondapi::bind]
|
||||
fn milla_track_pressure_tiles(
|
||||
|
||||
@@ -204,7 +204,3 @@ pub(crate) const BYOND_WIND_MULTIPLIER: f32 = 0.5;
|
||||
/// The smallest temperature allowed for the purpose of caluclating pressure.
|
||||
/// Prevents weirdness from absolute-zero gas having no pressure at all.
|
||||
pub(crate) const MINIMUM_TEMPERATURE_FOR_PRESSURE: f32 = 1.0;
|
||||
|
||||
/// How much of the excess temperature in a hotspot should be lost to the tile every tick.
|
||||
/// Makes hotspots die out if they're not burning fast enough.
|
||||
pub(crate) const HOTSPOT_CONDUCTION: f32 = 0.1;
|
||||
|
||||
@@ -637,22 +637,14 @@ pub(crate) fn react(my_next_tile: &mut Tile, hotspot_step: bool) {
|
||||
// THEN we can add in the new thermal energy.
|
||||
thermal_energy += PLASMA_BURN_ENERGY * plasma_burnt;
|
||||
// Recalculate temperature for any subsequent reactions.
|
||||
cached_temperature = thermal_energy / cached_heat_capacity;
|
||||
// (or we would, but this is the last reaction)
|
||||
//cached_temperature = thermal_energy / cached_heat_capacity;
|
||||
|
||||
my_next_tile.fuel_burnt += plasma_burnt;
|
||||
}
|
||||
|
||||
if hotspot_step {
|
||||
// Conduct some temperature to the tile.
|
||||
let mut conduction = 0.0;
|
||||
let tile_temperature = my_next_tile.temperature();
|
||||
let temperature_difference = cached_temperature - tile_temperature;
|
||||
if temperature_difference > 0.0 {
|
||||
let excess_thermal_energy = temperature_difference * cached_heat_capacity;
|
||||
conduction = excess_thermal_energy * HOTSPOT_CONDUCTION;
|
||||
my_next_tile.thermal_energy += conduction;
|
||||
}
|
||||
adjust_hotspot(my_next_tile, thermal_energy - initial_thermal_energy - conduction);
|
||||
adjust_hotspot(my_next_tile, thermal_energy - initial_thermal_energy);
|
||||
} else {
|
||||
my_next_tile.thermal_energy += thermal_energy - initial_thermal_energy;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user