summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-28 09:24:02 +0000
committertruelight <truelight@openttd.org>2004-12-28 09:24:02 +0000
commit15d188d7f83e3d090ccd8f24807d55dd4dc56946 (patch)
tree390251afe63fa4a46d59dd7366ef7aa9b3aa9f03 /main_gui.c
parent8dcbf2675b784ac3a060c046c10dc393c52f2772 (diff)
downloadopenttd-15d188d7f83e3d090ccd8f24807d55dd4dc56946.tar.xz
(svn r1284) -Fix: Fixed 'money-cheat' (read: bug which could give people a lot of money)
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main_gui.c b/main_gui.c
index 03c4db845..787390870 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -87,6 +87,9 @@ void HandleOnEditText(WindowEvent *e) {
// Give money
int32 money = atoi(e->edittext.str) / GetCurrentCurrencyRate();
char msg[100];
+
+ money = clamp(money, 0, 0xFFFFFFFF); // Clamp between 4 billion and 0
+
// Give 'id' the money, and substract it from ourself
if (!DoCommandP(0, money, id, NULL, CMD_GIVE_MONEY)) break;