(svn r1284) -Fix: Fixed 'money-cheat' (read: bug which could give people a lot of money)

This commit is contained in:
truelight
2004-12-28 09:24:02 +00:00
parent c0eeb710c7
commit bb1ad030e3
2 changed files with 8 additions and 0 deletions

View File

@@ -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;