fix static ram miscalc for stock market

This commit is contained in:
Olivier Gagnon 2021-10-27 17:35:02 -04:00
parent 49d807c9a9
commit a7632aed29
3 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -162,10 +162,9 @@ async function parseOnlyRamCalculate(
// Check if this identifier is a function in the workerScript environment. // Check if this identifier is a function in the workerScript environment.
// If it is, then we need to get its RAM cost. // If it is, then we need to get its RAM cost.
try { try {
function applyFuncRam(func: any): number { function applyFuncRam(cost: any): number {
console.log(func); if (typeof cost === "number") {
if (typeof func === "number") { return cost;
return func;
} else { } else {
return 0; return 0;
} }
@ -188,6 +187,8 @@ async function parseOnlyRamCalculate(
func = workerScript.env.vars.gang[ref]; func = workerScript.env.vars.gang[ref];
} else if (ref in workerScript.env.vars.sleeve) { } else if (ref in workerScript.env.vars.sleeve) {
func = workerScript.env.vars.sleeve[ref]; func = workerScript.env.vars.sleeve[ref];
} else if (ref in workerScript.env.vars.stock) {
func = workerScript.env.vars.stock[ref];
} else { } else {
func = workerScript.env.vars[ref]; func = workerScript.env.vars[ref];
} }