From d2a037a265cf0414d1e5ced95e4096714d3e9347 Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Mon, 1 Apr 2019 20:52:37 -0400
Subject: [PATCH] clamp rep to 0

---
 src/js/economyJS.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index 6d92bf1959e..39adaec4fa8 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -1217,7 +1217,13 @@ window.repX = function(rep, what, who) {
 	//Check if total rep is over cap, and use "overflow" category to expense it down if needed.
 	if (V.rep > 20000) {
 		V.lastWeeksRepExpenses.overflow += (20000 - V.rep); V.rep = 20000;
+	} 
+	
+	//Rep should never be lower than 0.  Record this rounding purely to keep the books balanced.
+	else if (V.rep < 0) {
+		V.lastWeeksRepIncome.overflow += (0 - V.rep); V.rep = 0;
 	}
+	
 	return rep;
 };
 
-- 
GitLab