mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Merge pull request #11344 from MrStonedOne/patch-32
Fixes a rounding error causing dynamic wait to be sluggish to kick in
This commit is contained in:
@@ -103,7 +103,7 @@ calculate the longest number of ticks the MC can wait between each cycle without
|
||||
var/oldwait = SS.wait
|
||||
var/GlobalCostDelta = (SSCostPerSecond-(SS.cost/(SS.wait/10)))-1
|
||||
var/NewWait = MC_AVERAGE(oldwait,(SS.cost-SS.dwait_buffer+GlobalCostDelta)*SS.dwait_delta)
|
||||
SS.wait = Clamp(round(NewWait,world.tick_lag),SS.dwait_lower,SS.dwait_upper)
|
||||
SS.wait = Clamp(NewWait,SS.dwait_lower,SS.dwait_upper)
|
||||
if (oldwait != SS.wait)
|
||||
calculateGCD()
|
||||
SS.next_fire += SS.wait
|
||||
@@ -147,4 +147,4 @@ calculate the longest number of ticks the MC can wait between each cycle without
|
||||
msg += "\t [varname] = [varval]\n"
|
||||
world.log << msg
|
||||
|
||||
subsystems = master_controller.subsystems
|
||||
subsystems = master_controller.subsystems
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
/datum/subsystem/proc/stat_entry(msg)
|
||||
var/dwait = ""
|
||||
if (dynamic_wait)
|
||||
dwait = "DWait:[wait]ds "
|
||||
dwait = "DWait:[round(wait,0.1)]ds "
|
||||
|
||||
stat(name, "[round(cost,0.001)]ds\t[dwait][msg]")
|
||||
|
||||
@@ -59,4 +59,4 @@
|
||||
|
||||
//usually called via datum/subsystem/New() when replacing a subsystem (i.e. due to a recurring crash)
|
||||
//should attempt to salvage what it can from the old instance of subsystem
|
||||
/datum/subsystem/proc/Recover()
|
||||
/datum/subsystem/proc/Recover()
|
||||
|
||||
Reference in New Issue
Block a user