1
0
Fork 0

(svn r5599) GetPrevVehicleInChain() may never fail to find a valid vehicle. Reflect this in the code

release/0.5
tron 2006-07-23 17:17:43 +00:00
parent 79e1f4eea0
commit c4ed8e9ec4
1 changed files with 2 additions and 4 deletions

View File

@ -486,11 +486,9 @@ Vehicle *GetPrevVehicleInChain(const Vehicle *v)
// Check to see if this is the first // Check to see if this is the first
if (v == u) return NULL; if (v == u) return NULL;
do { for (; u->next != v; u = u->next) assert(u->next != NULL);
if (u->next == v) return u;
} while ( ( u = u->next) != NULL);
return NULL; return u;
} }
/** Finds the first vehicle in a chain. /** Finds the first vehicle in a chain.