Cheat: Add cheats to set inflation income and cost factors

See: #124
This commit is contained in:
Jonathan G Rennison
2020-04-18 10:52:08 +01:00
parent 3e7618f519
commit 1506479f56
5 changed files with 91 additions and 10 deletions

View File

@@ -249,6 +249,32 @@ CommandCost CmdCheatSetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
cht = &_cheats.no_jetcrash;
break;
case CHT_INFLATION_INCOME:
if (flags & DC_EXEC) {
_extra_cheats.inflation_income.been_used = true;
_economy.inflation_payment = Clamp<uint64>(p2, 1 << 16, MAX_INFLATION);
if (_economy.inflation_payment > _economy.inflation_prices) {
_economy.inflation_prices = _economy.inflation_payment;
_extra_cheats.inflation_cost.been_used = true;
}
RecomputePrices();
SetWindowDirty(WC_CHEATS, 0);
}
return CommandCost();
case CHT_INFLATION_COST:
if (flags & DC_EXEC) {
_extra_cheats.inflation_cost.been_used = true;
_economy.inflation_prices = Clamp<uint64>(p2, 1 << 16, MAX_INFLATION);
if (_economy.inflation_payment > _economy.inflation_prices) {
_economy.inflation_payment = _economy.inflation_prices;
_extra_cheats.inflation_income.been_used = true;
}
RecomputePrices();
SetWindowDirty(WC_CHEATS, 0);
}
return CommandCost();
default:
return CMD_ERROR;
}