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
commit0d8e82b7d742b54216bf6bc8a1d3b4eafe8124ab (patch)
tree4d9bfa9de886f7ff167c4fa02326f5cd302e8cce /src/main_gui.cpp
parentc755fa43d08e5adaad87745769369ec8e5e59915 (diff)
downloadopenttd-0d8e82b7d742b54216bf6bc8a1d3b4eafe8124ab.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();