diff --git a/code/fgame/vehicle.cpp b/code/fgame/vehicle.cpp index 1d691345d..6f8ca73bd 100644 --- a/code/fgame/vehicle.cpp +++ b/code/fgame/vehicle.cpp @@ -3465,28 +3465,27 @@ void Vehicle::SetupPath(cVehicleSpline *pPath, SimpleEntity *se) vLastOrigin = se->origin; - for (ent = se; ent != NULL; ent = ent->Next(), i++) { + for (ent = se; ent; ent = ent->Next(), i++) { Vector vDelta = vLastOrigin - ent->origin; float vTmp[4]; if (vDelta.length() == 0 && i > 1) { Com_Printf("^~^~^Warning: Vehicle Driving with a Path that contains 2 equal points\n"); - continue; - } + } else { + fCurLength += vDelta.length(); - fCurLength += vDelta.length(); + vTmp[0] = fCurLength; + VectorCopy(ent->origin, vTmp + 1); - vTmp[0] = fCurLength; - VectorCopy(ent->origin, vTmp + 1); + if (ent->IsSubclassOfVehiclePoint()) { + pPath->Add(vTmp, static_cast(ent)->spawnflags); + } else { + pPath->Add(vTmp, 0); + } - if (ent->IsSubclassOfVehiclePoint()) { - pPath->Add(vTmp, static_cast(ent)->spawnflags); - } else { - pPath->Add(vTmp, 0); + vLastOrigin = ent->origin; } - vLastOrigin = ent->origin; - if (ent == se && i > 1) { break; }