summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-21 14:32:27 +0000
committerrubidium <rubidium@openttd.org>2007-06-21 14:32:27 +0000
commitf806b46cc967202db3d2fbf3384d0f037c13ed8a (patch)
tree4d9bfa9de886f7ff167c4fa02326f5cd302e8cce /src/main_gui.cpp
parent06fded123a346d556ceb2f4585429046ddf8f1b9 (diff)
downloadopenttd-f806b46cc967202db3d2fbf3384d0f037c13ed8a.tar.xz
(svn r10246) -Fix (r10297): some forgotten money conversions and truncation issues. Thanks to benc for providing the patch.
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 430d9948f..a7896b62d 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -94,10 +94,10 @@ void HandleOnEditText(const char *str)
const Player *p = GetPlayer(_current_player);
Money money = min(p->player_money - p->current_loan, atoi(str) / _currency->rate);
- money = clamp(money, 0, 20000000); // Clamp between 20 million and 0
+ uint32 money_c = clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0
/* Give 'id' the money, and substract it from ourself */
- DoCommandP(0, money, id, CcGiveMoney, CMD_GIVE_MONEY | CMD_MSG(STR_INSUFFICIENT_FUNDS));
+ DoCommandP(0, money_c, id, CcGiveMoney, CMD_GIVE_MONEY | CMD_MSG(STR_INSUFFICIENT_FUNDS));
} break;
#endif /* ENABLE_NETWORK */
default: NOT_REACHED();