From a4382d3358f61217c1c5cbf575a6ddd13982d9ef Mon Sep 17 00:00:00 2001 From: MouseOfLight <MouseOfLight@gmail.com> Date: Wed, 9 Oct 2019 16:39:19 -0700 Subject: [PATCH] typo --- src/Corporation/corporate.js | 12 ++++++++---- src/Corporation/corporateWidgets.tw | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Corporation/corporate.js b/src/Corporation/corporate.js index 56cc30298ba..7b3ddf515b6 100644 --- a/src/Corporation/corporate.js +++ b/src/Corporation/corporate.js @@ -654,7 +654,7 @@ App.Corporate.Init = function() { }; App.Corporate.chargeAsset = function(cost, type) { if(!Number.isFinite(cost)) throw "The cost provided was not a real number"; - if(!type in this.ledger.current) throw `Ledger doesn't record '${type}' category.`; + if(!(type in this.ledger.current)) throw `Ledger doesn't record '${type}' category.`; if(cost == 0) return; this.ledger.current[type] += cost; @@ -663,12 +663,16 @@ App.Corporate.Init = function() { App.Corporate.earnRevenue = function(cost, locality) { if(!Number.isFinite(cost)) throw "The cost provided was not real" let current = this.ledger.current; - let key = `${locality}revenue`; - if(!key in current) throw `Unknown locality '${locality}'`; + let key = `${locality}Revenue`; + if(!(key in current)) throw `Unknown locality '${locality}'`; current[key] += cost; this.cash += cost; }; App.Corporate.chargeDividend = function(cost, weekLedger) { + if(weekLedger == null) { + debugger; + throw "No weekLedger provided"; + } this.dividend += cost; this.cash -= cost; weekLedger.dividend += cost; @@ -891,7 +895,7 @@ App.Corporate.Init = function() { { this.specializationTime--; } - this.calculateDividend(); + this.calculateDividend(ledger); return ledger; }; diff --git a/src/Corporation/corporateWidgets.tw b/src/Corporation/corporateWidgets.tw index 6a3b70b633c..330d105ef8c 100644 --- a/src/Corporation/corporateWidgets.tw +++ b/src/Corporation/corporateWidgets.tw @@ -74,7 +74,7 @@ Usage: <div class="note">Pays out on <<=asDateString($week + App.Corporate.dividendTimer, -1)>>, <<if App.Corporate.dividendTimer == 1>> the end of this week <<else>> - in App.Corporate.dividendTimer weeks + in <<= App.Corporate.dividendTimer >> weeks <</if>> </div> </td></tr> -- GitLab