mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-24 08:01:33 +00:00
(svn r3128) -Fix: [autoreplace] fixed bug that made the player pay twice for autoreplacing and could end up with negative money
This commit is contained in:
parent
80af1ebca8
commit
b950fee119
@ -1616,7 +1616,7 @@ static void MaybeReplaceVehicle(Vehicle *v)
|
||||
Vehicle *w;
|
||||
const Player *p = GetPlayer(v->owner);
|
||||
byte flags = 0;
|
||||
int32 cost = 0, temp_cost = 0;
|
||||
int32 cost, temp_cost = 0;
|
||||
bool stopped = false;
|
||||
|
||||
_current_player = v->owner;
|
||||
@ -1632,6 +1632,7 @@ static void MaybeReplaceVehicle(Vehicle *v)
|
||||
}
|
||||
|
||||
while (true) {
|
||||
cost = 0;
|
||||
w = v;
|
||||
do {
|
||||
// check if the vehicle should be replaced
|
||||
|
Loading…
Reference in New Issue
Block a user