VERSION: Update game version to 2.2 (#240)

Includes some bug fixes:
* Fix sleeve shock internal/display discrepancy (0-100 vs 0-100)
* Special error message if ns function called without a this
* Change whitespace to pre-wrap for dialog box.
* Fix bug where idle sleeves do not consume cycles but still recover shock from those cycles. Now they do not recover during idle.
* attempted to tag commit as v2.2.0
This commit is contained in:
Snarling
2022-12-01 16:07:46 -05:00
committed by GitHub
parent 6034e1c3fa
commit 5ff2cd5357
14 changed files with 441 additions and 505 deletions
+8
View File
@@ -46,6 +46,14 @@ export class StampedLayer {
const arrayPath = [...tree, key];
const functionPath = arrayPath.join(".");
function wrappedFunction(this: StampedLayer, ...args: unknown[]): unknown {
if (!this)
throw new Error(`
ns.${functionPath} called with no this value.
ns functions must be bound to ns if placed in a new
variable. e.g.
const ${key} = ns.${functionPath}.bind(ns);
${key}(${JSON.stringify(args).replace(/^\[|\]$/g, "")});\n\n`);
const ctx = { workerScript: this.#workerScript, function: key, functionPath };
helpers.checkEnvFlags(ctx);
helpers.updateDynamicRam(ctx, getRamCost(...tree, key));