game: clamp correctly money amount

This commit is contained in:
jeefo 2023-05-08 23:11:17 +03:00
commit 2ff06051de
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED

View file

@ -222,7 +222,15 @@ void MessageDispatcher::netMsgMoney () {
if (m_args.length () < min || !m_bot) {
return;
}
m_bot->m_moneyAmount = cr::clamp (m_args[money].long_, 160000, INT32_MAX);
auto amount = m_args[money].long_;
if (amount < 0) {
amount = 800;
}
else if (amount > INT32_MAX) {
amount = 16000;
}
m_bot->m_moneyAmount = amount;
}
void MessageDispatcher::netMsgStatusIcon () {