mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +01:00
Various Delta Time Fixes (#21871)
Organs were being given ~3 seconds of DT per ~2 seconds of real time, because they were being hit by Process() TWICE, once during processing for the "Set of all objects", and again during processing for the "Set of all mobs". No species was hit harder than this but IPCs, who suffered from having wildly inconsistent temperature mechanics that seemingly never matched the expected numbers. I have actually tested this PR to verify that it works. I even went the extra mile to more extensively test IPC temperature mechanics to find a separate bug unrelated to DTs that was causing suit coolers to just straight up not work at all (space suit or otherwise) on a majority of all IPC subspecies. I then tested the numbers in the PR for IPC cooling to verify that things work as intended. <img width="969" height="623" alt="image" src="https://github.com/user-attachments/assets/01c3aca7-b436-4e52-86f7-aed847dcba5e" /> I also tweaked all the subsystems to have a small performance improvement. --------- Signed-off-by: VMSolidus <evilexecutive@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
var/on = 0 //is it turned on?
|
||||
var/cover_open = 0 //is the cover open?
|
||||
var/obj/item/cell/cell
|
||||
var/max_cooling = 24 //in degrees per second - probably don't need to mess with heat capacity here
|
||||
var/max_cooling = 24 //in degrees kelvin per second - probably don't need to mess with heat capacity here
|
||||
var/charge_consumption = 8.3 //charge per second at max_cooling
|
||||
var/thermostat = T20C
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
return (H.back == src) || (H.s_store == src)
|
||||
|
||||
/obj/item/suit_cooling_unit/process()
|
||||
/obj/item/suit_cooling_unit/process(seconds_per_tick)
|
||||
if(!on || !cell)
|
||||
return
|
||||
|
||||
@@ -86,18 +86,16 @@
|
||||
|
||||
var/mob/living/carbon/human/H = loc
|
||||
|
||||
var/efficiency = !!(H.species.flags & ACCEPTS_COOLER) || 1 - H.get_pressure_weakness() //you need to have a good seal for effective cooling; some species can directly connect to the cooler, so get a free 100% efficiency here
|
||||
var/efficiency = isipc(H) || 1 - H.get_pressure_weakness() //you need to have a good seal for effective cooling; some species can directly connect to the cooler, so get a free 100% efficiency here
|
||||
var/env_temp = get_environment_temperature() //wont save you from a fire
|
||||
var/temp_adj = min(H.bodytemperature - max(thermostat, env_temp), max_cooling)
|
||||
|
||||
if(temp_adj < 0.5) //only cools, doesn't heat, also we don't need extreme precision
|
||||
return
|
||||
|
||||
var/charge_usage = (temp_adj/max_cooling)*charge_consumption
|
||||
H.bodytemperature = max(T0C, H.bodytemperature - temp_adj * efficiency * seconds_per_tick)
|
||||
|
||||
H.bodytemperature = max(T0C, H.bodytemperature - temp_adj*efficiency)
|
||||
|
||||
cell.use(charge_usage)
|
||||
cell.use((temp_adj/max_cooling) * charge_consumption * seconds_per_tick)
|
||||
|
||||
if(cell.charge <= 0)
|
||||
turn_off()
|
||||
|
||||
Reference in New Issue
Block a user