From 1a5891cb09e92756761b53371fa6fafcef5c3984 Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Sat, 19 Jan 2019 18:27:08 -0500
Subject: [PATCH] Improve error reports, patch twineJS

---
 devNotes/twine JS.txt | 9 +++------
 src/js/economyJS.tw   | 4 ++--
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt
index b617bfbc596..ba55b692835 100644
--- a/devNotes/twine JS.txt	
+++ b/devNotes/twine JS.txt	
@@ -3179,7 +3179,7 @@ window.cashX = function(cost, what, who) {
 				if (typeof V.lastWeeksCashIncome[what] !== 'undefined') {
 					V.lastWeeksCashIncome[what] += cost;
 				} else {
-					V.lastWeeksErrors += `Unknown place "${what}",`;
+					V.lastWeeksErrors += `Unknown place "${what}", gained you ${cost}`;
 				}
 				
 				//record the slave, if available
@@ -3196,7 +3196,7 @@ window.cashX = function(cost, what, who) {
 			if (typeof V.lastWeeksCashExpenses[what] !== 'undefined') {
 				V.lastWeeksCashExpenses[what] += cost;
 			} else {
-				V.lastWeeksErrors += `Unknown place "${what}",`;
+				V.lastWeeksErrors += `Unknown place "${what}" charged you ${cost},`;
 			}
 
 			//record the slave, if available
@@ -3213,10 +3213,7 @@ window.cashX = function(cost, what, who) {
 };
 
 window.forceNeg = function(x) {
-	if (x > 0){
-		x = Math.abs(x) * -1;
-	}
-	return x;
+	return -Math.abs(x);
 };
 
 Number.prototype.toFixedHTML = function() {
diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw
index 8ac5d2cab7d..8a91562a86c 100644
--- a/src/js/economyJS.tw
+++ b/src/js/economyJS.tw
@@ -983,7 +983,7 @@ window.cashX = function(cost, what, who) {
 				if (typeof V.lastWeeksCashIncome[what] !== 'undefined') {
 					V.lastWeeksCashIncome[what] += cost;
 				} else {
-					V.lastWeeksErrors += `Unknown place "${what}",`;
+					V.lastWeeksErrors += `Unknown place "${what}", gained you ${cost}`;
 				}
 				
 				//record the slave, if available
@@ -1000,7 +1000,7 @@ window.cashX = function(cost, what, who) {
 			if (typeof V.lastWeeksCashExpenses[what] !== 'undefined') {
 				V.lastWeeksCashExpenses[what] += cost;
 			} else {
-				V.lastWeeksErrors += `Unknown place "${what}",`;
+				V.lastWeeksErrors += `Unknown place "${what}" charged you ${cost},`;
 			}
 
 			//record the slave, if available
-- 
GitLab