world.fps

This commit is contained in:
L
2019-07-17 10:31:08 -03:00
parent dc03a88a9c
commit a03b33be2e
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -202,7 +202,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
// Sort subsystems by display setting for easy access.
sortTim(subsystems, /proc/cmp_subsystem_display)
// Set world options.
world.fps = CONFIG_GET(number/fps)
world.change_fps(CONFIG_GET(number/fps))
var/initialized_tod = REALTIMEOFDAY
if(sleep_offline_after_initializations)
+11
View File
@@ -306,3 +306,14 @@ GLOBAL_VAR(restart_counter)
maxz++
SSmobs.MaxZChanged()
SSidlenpcpool.MaxZChanged()
/world/proc/change_fps(new_value = 20)
if(new_value <= 0)
CRASH("change_fps() called with [new_value] new_value.")
if(fps == new_value)
return //No change required.
fps = new_value
SStimer?.reset_buckets()
+1 -1
View File
@@ -23,4 +23,4 @@
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Set Server FPS", "[new_fps]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
CONFIG_SET(number/fps, new_fps)
world.fps = new_fps
world.change_fps(new_fps)