1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 21:19:10 +00:00

(svn r10246) -Fix (r10297): some forgotten money conversions and truncation issues. Thanks to benc for providing the patch.

This commit is contained in:
rubidium
2007-06-21 14:32:27 +00:00
parent 06fded123a
commit f806b46cc9
25 changed files with 94 additions and 82 deletions

View File

@@ -418,10 +418,10 @@ error:
return res;
}
int32 GetAvailableMoneyForCommand()
Money GetAvailableMoneyForCommand()
{
PlayerID pid = _current_player;
if (!IsValidPlayer(pid)) return 0x7FFFFFFF; // max int
if (!IsValidPlayer(pid)) return INT64_MAX;
return GetPlayer(pid)->player_money;
}
@@ -568,7 +568,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
if (IsLocalPlayer() && _game_mode != GM_EDITOR) {
if (res2.GetCost() != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2.GetCost());
if (_additional_cash_required) {
if (_additional_cash_required != 0) {
SetDParam(0, _additional_cash_required);
ShowErrorMessage(STR_0003_NOT_ENOUGH_CASH_REQUIRES, error_part1, x, y);
if (res2.GetCost() == 0) goto callb_err;