(svn r3128) -Fix: [autoreplace] fixed bug that made the player pay twice for autoreplacing and could end up with negative money
authorbjarni
Thu, 03 Nov 2005 20:19:15 +0000
changeset 2591 76a053785b35
parent 2590 5603f43c8cd3
child 2592 bec1bf2313df
(svn r3128) -Fix: [autoreplace] fixed bug that made the player pay twice for autoreplacing and could end up with negative money
vehicle.c
--- a/vehicle.c	Thu Nov 03 19:51:28 2005 +0000
+++ b/vehicle.c	Thu Nov 03 20:19:15 2005 +0000
@@ -1616,7 +1616,7 @@
 	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 @@
 	}
 
 	while (true) {
+		cost = 0;
 		w = v;
 		do {
 			// check if the vehicle should be replaced