diff --git a/exp_scenario/controller.ts b/exp_scenario/controller.ts index 110c6c86..1438652f 100644 --- a/exp_scenario/controller.ts +++ b/exp_scenario/controller.ts @@ -1,5 +1,5 @@ import * as lib from "@clusterio/lib"; -import { BaseControllerPlugin, InstanceInfo } from "@clusterio/controller"; +import { BaseControllerPlugin } from "@clusterio/controller"; export class ControllerPlugin extends BaseControllerPlugin { async init() { diff --git a/exp_scenario/module/control.lua b/exp_scenario/module/control.lua index 65e35d78..85da0174 100644 --- a/exp_scenario/module/control.lua +++ b/exp_scenario/module/control.lua @@ -78,6 +78,6 @@ add(require("modules/exp_scenario/gui/production_stats")) add(require("modules/exp_scenario/gui/quick_actions")) add(require("modules/exp_scenario/gui/readme")) add(require("modules/exp_scenario/gui/research_milestones")) -add(require("modules/exp_scenario/gui/science_production")) +-- add(require("modules/exp_scenario/gui/science_production")) add(require("modules/exp_scenario/gui/surveillance")) add(require("modules/exp_scenario/gui/task_list")) diff --git a/exp_scenario/module/control/extra_logging.lua b/exp_scenario/module/control/extra_logging.lua index d469c390..4a9da9db 100644 --- a/exp_scenario/module/control/extra_logging.lua +++ b/exp_scenario/module/control/extra_logging.lua @@ -38,7 +38,7 @@ local function on_pre_player_died(event) local cause = event.cause if cause then if cause.type == "character" then - add_log_line("[DEATH]", player.name, "died because of", cause.player.name) + add_log_line("[DEATH]", player.name, "died because of", (cause.player and cause.player.name) or cause.name) else add_log_line("[DEATH]", player.name, "died because of", cause.name) end diff --git a/exp_server_ups/instance.ts b/exp_server_ups/instance.ts index 1783acc3..ee6357d3 100644 --- a/exp_server_ups/instance.ts +++ b/exp_server_ups/instance.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import * as lib from "@clusterio/lib"; import { BaseInstancePlugin } from "@clusterio/host"; @@ -20,7 +21,7 @@ export class InstancePlugin extends BaseInstancePlugin { this.clearInterval(); this.setInterval(); } else if (field === "exp_server_ups.average_interval") { - this.gameTimes.splice(curr as number); + this.gameTimes = []; } } @@ -51,8 +52,7 @@ export class InstancePlugin extends BaseInstancePlugin { if (collected > 0) { const minTick = this.gameTimes[0]; const maxTick = this.gameTimes[collected]; - const interval = this.instance.config.get("exp_server_ups.update_interval") / 1000; - ups = (maxTick - minTick) / (collected * interval); + ups = (maxTick - minTick) / (collected * (this.instance.config.get("exp_server_ups.update_interval") / 1000)); } try { @@ -61,9 +61,9 @@ export class InstancePlugin extends BaseInstancePlugin { } catch (error: any) { this.logger.error(`Failed to receive new game time: ${error}`); } - + if (collected > this.instance.config.get("exp_server_ups.average_interval")) { - this.gameTimes.shift(); - } + this.gameTimes.shift(); + } } }