summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
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();