From f5daacfa8f04e64379a30e9ed0beeec902474f76 Mon Sep 17 00:00:00 2001 From: Dimava Date: Fri, 5 Jun 2020 10:31:08 +0300 Subject: [PATCH] fix debug.disableDynamicTickrate --- src/js/game/dynamic_tickrate.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/game/dynamic_tickrate.js b/src/js/game/dynamic_tickrate.js index 97591bba..e9979494 100644 --- a/src/js/game/dynamic_tickrate.js +++ b/src/js/game/dynamic_tickrate.js @@ -60,11 +60,12 @@ export class DynamicTickrate { * Increases the tick rate marginally */ increaseTickRate() { - if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) { + const desiredFps = this.root.app.settings.getDesiredFps(); + if ((G_IS_DEV && globalConfig.debug.renderForTrailer) || globalConfig.debug.disableDynamicTickrate) { + this.setTickRate(Math_round(Math_min(desiredFps, this.currentTickRate * 1.2))); return; } - const desiredFps = this.root.app.settings.getDesiredFps(); this.setTickRate(Math_round(Math_min(desiredFps, this.currentTickRate * 1.2))); } @@ -72,11 +73,12 @@ export class DynamicTickrate { * Decreases the tick rate marginally */ decreaseTickRate() { - if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) { + const desiredFps = this.root.app.settings.getDesiredFps(); + if ((G_IS_DEV && globalConfig.debug.renderForTrailer) || globalConfig.debug.disableDynamicTickrate) { + this.setTickRate(Math_round(Math_max(desiredFps, this.currentTickRate * 0.8))); return; } - const desiredFps = this.root.app.settings.getDesiredFps(); this.setTickRate(Math_round(Math_max(desiredFps / 2, this.currentTickRate * 0.8))); }