summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-18 21:00:14 +0000
committerrubidium <rubidium@openttd.org>2007-06-18 21:00:14 +0000
commit7a72dcb3b57b70214c4d402be89f9b1dd158d790 (patch)
tree1ba3bbf25a5886a7f40a02d3403d53c57e634d75 /src/autoreplace_cmd.cpp
parent26e9b5ca5f0eafae421a640ea4e4753d6ac7ec0e (diff)
downloadopenttd-7a72dcb3b57b70214c4d402be89f9b1dd158d790.tar.xz
(svn r10207) -Codechange: remove the redundant player_money in favour of the money64, which is now renamed to player_money.
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 0a2fd313c..37e0f79d8 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -260,7 +260,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, int32 total_cost)
/* Ensure that the player will not end up having negative money while autoreplacing
* This is needed because the only other check is done after the income from selling the old vehicle is substracted from the cost */
- if (CmdFailed(tmp_move) || p->money64 < (cost.GetCost() + total_cost)) {
+ if (CmdFailed(tmp_move) || p->player_money < (cost.GetCost() + total_cost)) {
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
/* Pay back the loan */
sell_value.MultiplyCost(-1);
@@ -372,8 +372,8 @@ CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
cost.AddCost(temp_cost);
} while (w->type == VEH_TRAIN && (w = GetNextVehicle(w)) != NULL);
- if (!(flags & DC_EXEC) && (p->money64 < (int32)(cost.GetCost() + p->engine_renew_money) || cost.GetCost() == 0)) {
- if (!check && p->money64 < (int32)(cost.GetCost() + p->engine_renew_money) && ( _local_player == v->owner ) && cost.GetCost() != 0) {
+ if (!(flags & DC_EXEC) && (p->player_money < (cost.GetCost() + p->engine_renew_money) || cost.GetCost() == 0)) {
+ if (!check && p->player_money < (cost.GetCost() + p->engine_renew_money) && ( _local_player == v->owner ) && cost.GetCost() != 0) {
StringID message;
SetDParam(0, v->unitnumber);
switch (v->type) {