From 6af8bd605eaadc001fe82c7d804796058871d785 Mon Sep 17 00:00:00 2001 From: bjarni Date: Thu, 3 Nov 2005 20:19:15 +0000 Subject: [PATCH] (svn r3128) -Fix: [autoreplace] fixed bug that made the player pay twice for autoreplacing and could end up with negative money --- vehicle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vehicle.c b/vehicle.c index 47a686f8ad..b642daceaf 100644 --- a/vehicle.c +++ b/vehicle.c @@ -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