Codechange: pass (uint) money as Money for CmdGiveMoney

This commit is contained in:
Rubidium
2023-05-05 11:37:17 +02:00
committed by rubidium42
parent 4a5a9f57c4
commit e33b2afd87
3 changed files with 4 additions and 6 deletions

View File

@@ -2646,10 +2646,8 @@ struct CompanyWindow : Window
default: NOT_REACHED();
case WID_C_GIVE_MONEY: {
Money money = (Money)(std::strtoull(str, nullptr, 10) / _currency->rate);
uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0
Command<CMD_GIVE_MONEY>::Post(STR_ERROR_CAN_T_GIVE_MONEY, money_c, (CompanyID)this->window_number);
Money money = std::strtoull(str, nullptr, 10) / _currency->rate;
Command<CMD_GIVE_MONEY>::Post(STR_ERROR_CAN_T_GIVE_MONEY, money, (CompanyID)this->window_number);
break;
}