(svn r3128) -Fix: [autoreplace] fixed bug that made the player pay twice for autoreplacing and could end up with negative money

pull/155/head
bjarni 19 years ago
parent 069ff61ef5
commit 6af8bd605e

@ -1616,7 +1616,7 @@ static void MaybeReplaceVehicle(Vehicle *v)
Vehicle *w; Vehicle *w;
const Player *p = GetPlayer(v->owner); const Player *p = GetPlayer(v->owner);
byte flags = 0; byte flags = 0;
int32 cost = 0, temp_cost = 0; int32 cost, temp_cost = 0;
bool stopped = false; bool stopped = false;
_current_player = v->owner; _current_player = v->owner;
@ -1632,6 +1632,7 @@ static void MaybeReplaceVehicle(Vehicle *v)
} }
while (true) { while (true) {
cost = 0;
w = v; w = v;
do { do {
// check if the vehicle should be replaced // check if the vehicle should be replaced

Loading…
Cancel
Save