game: clamp correctly money amount
This commit is contained in:
parent
0842dd7b4e
commit
2ff06051de
1 changed files with 9 additions and 1 deletions
|
|
@ -222,7 +222,15 @@ void MessageDispatcher::netMsgMoney () {
|
||||||
if (m_args.length () < min || !m_bot) {
|
if (m_args.length () < min || !m_bot) {
|
||||||
return;
|
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 () {
|
void MessageDispatcher::netMsgStatusIcon () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue