CODEBASE: Add more debug info for troubleshooting corporation issues (#2327)

This commit is contained in:
catloversg
2025-09-29 04:34:35 +07:00
committed by GitHub
parent bb8552fa81
commit 9c2a5c25cb
2 changed files with 9 additions and 4 deletions

View File

@@ -161,9 +161,11 @@ export class Division {
//Then calculate salaries and process the markets
if (state === "START") {
if (isNaN(this.thisCycleRevenue) || isNaN(this.thisCycleExpenses)) {
console.error("NaN in Corporation's computed revenue/expenses");
dialogBoxCreate(
"Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer",
exceptionAlert(
new Error(
`Invalid revenue/expenses. thisCycleRevenue: ${this.thisCycleRevenue}. thisCycleExpenses: ${this.thisCycleExpenses}`,
),
true,
);
this.thisCycleRevenue = 0;
this.thisCycleExpenses = 0;

View File

@@ -65,7 +65,10 @@ export class Warehouse {
this.sizeUsed += mat.stored * MaterialInfo[matName].size;
}
if (this.sizeUsed > this.size) {
console.warn("Warehouse size used greater than capacity, something went wrong");
console.warn(
`Warehouse size used greater than capacity, something went wrong. sizeUsed: ${this.sizeUsed}. size: ${this.size}`,
this,
);
}
}