(svn r5599) GetPrevVehicleInChain() may never fail to find a valid vehicle. Reflect this in the code
authortron
Sun, 23 Jul 2006 17:17:43 +0000
changeset 4165 2b5f642aa2bf
parent 4164 1654518ef5c4
child 4166 e187f9a19081
(svn r5599) GetPrevVehicleInChain() may never fail to find a valid vehicle. Reflect this in the code
vehicle.c
--- a/vehicle.c	Sun Jul 23 08:40:49 2006 +0000
+++ b/vehicle.c	Sun Jul 23 17:17:43 2006 +0000
@@ -486,11 +486,9 @@
 	// Check to see if this is the first
 	if (v == u) return NULL;
 
-	do {
-		if (u->next == v) return u;
-	} while ( ( u = u->next) != NULL);
-
-	return NULL;
+	for (; u->next != v; u = u->next) assert(u->next != NULL);
+
+	return u;
 }
 
 /** Finds the first vehicle in a chain.