mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-16 10:27:14 +01:00
Lag War Day 4: Under Pressure, High Voltage (#21878)
Replace /datum/gas_mixture/proc/return_pressure with XGM_PRESSURE(xgm) macro. Having such a relatively simple statement contributing proc overhead to procs called millions of times is ridiculous Rename /datum/gas_mixture/proc/zburn to react, deleting the old react which was just an alias for it. Free proc overhead Turn check_combustibility into a macro CHECK_COMBUSTIBLE(is_cmb, xgm). also rewrite it slightly so that it only needs to do one pass. Its a bit nasty so I apologize for that, but speeeeed. Delete most powernet and obj/machinery/power procs for handling power, replacing them with macros. The fact that we were unironically calling a draw_power() on APCs to call draw_power() on their terminals to call draw_power() on their powernet every single process tick was insane. Turn `between` into a macro alias for clamp() since the param order is different turn `Percent` into a macro AS_PCT Rewrite significant chunks of update_canmove so its not quite as horrifying of a proc and hopefully doesn't eat the entire mob subsystem every movement now
This commit is contained in:
@@ -36,10 +36,10 @@
|
||||
affected_mobs |= user
|
||||
for(var/area/AffectedArea in affected_areas)
|
||||
AffectedArea.power_light = 0
|
||||
AffectedArea.power_change()
|
||||
SEND_SIGNAL(AffectedArea, COMSIG_AREA_POWER_CHANGE)
|
||||
spawn(rand(25,50))
|
||||
AffectedArea.power_light = 1
|
||||
AffectedArea.power_change()
|
||||
SEND_SIGNAL(AffectedArea, COMSIG_AREA_POWER_CHANGE)
|
||||
|
||||
sleep(100)
|
||||
for(var/mob/M in affected_mobs)
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
var/t = SPAN_NOTICE("Coordinates: [T.x],[T.y],[T.z]\n")
|
||||
t += SPAN_WARNING("Temperature: [env.temperature]\n")
|
||||
t += SPAN_WARNING("Pressure: [env.return_pressure()]kPa\n")
|
||||
t += SPAN_WARNING("Pressure: [XGM_PRESSURE(env)]kPa\n")
|
||||
for(var/g in env.gas)
|
||||
t += SPAN_NOTICE("[g]: [env.gas[g]] / [env.gas[g] * R_IDEAL_GAS_EQUATION * env.temperature / env.volume]kPa\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user