1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-02-11 18:39:21 +00:00

debug.disableBulkOperations & debug.disableDynamicTickrate

This commit is contained in:
Dimava 2020-05-31 23:06:59 +03:00
parent 328de2b033
commit ae5763be9b
2 changed files with 8 additions and 4 deletions

View File

@ -60,7 +60,7 @@ export class DynamicTickrate {
* Increases the tick rate marginally
*/
increaseTickRate() {
if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) {
return;
}
@ -72,7 +72,7 @@ export class DynamicTickrate {
* Decreases the tick rate marginally
*/
decreaseTickRate() {
if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) {
return;
}

View File

@ -8,6 +8,7 @@ import { createLogger } from "../core/logging";
import { MetaBeltBaseBuilding, arrayBeltVariantToRotation } from "./buildings/belt_base";
import { SOUNDS } from "../platform/sound";
import { round2Digits } from "../core/utils";
import { globalConfig } from "../core/config";
const logger = createLogger("ingame/logic");
@ -199,12 +200,15 @@ export class GameLogic {
performBulkOperation(operation) {
logger.log("Running bulk operation ...");
assert(!this.root.bulkOperationRunning, "Can not run two bulk operations twice");
this.root.bulkOperationRunning = true;
this.root.bulkOperationRunning = true && !globalConfig.debug.disableBulkOperations;
const now = performanceNow();
const returnValue = operation();
const duration = performanceNow() - now;
logger.log("Done in", round2Digits(duration), "ms");
assert(this.root.bulkOperationRunning, "Bulk operation = false while bulk operation was running");
assert(
this.root.bulkOperationRunning || globalConfig.debug.disableBulkOperations,
"Bulk operation = false while bulk operation was running"
);
this.root.bulkOperationRunning = false;
this.root.signals.bulkOperationFinished.dispatch();
return returnValue;