Code clarity

This commit is contained in:
smallmodel 2024-03-03 22:47:31 +01:00
parent 2e32395cf2
commit 63456beeb0
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -3465,23 +3465,24 @@ void Vehicle::SetupPath(cVehicleSpline *pPath, SimpleEntity *se)
Vector vDelta = vLastOrigin - ent->origin;
float vTmp[4];
if (vDelta.length() == 0.0f && i > 1) {
if (vDelta.length() == 0 && i > 1) {
Com_Printf("^~^~^Warning: Vehicle Driving with a Path that contains 2 equal points\n");
} else {
fCurLength += vDelta.length();
vTmp[0] = fCurLength;
VectorCopy(ent->origin, vTmp + 1);
if (ent->IsSubclassOfVehiclePoint()) {
pPath->Add(vTmp, static_cast<VehiclePoint *>(ent)->spawnflags);
} else {
pPath->Add(vTmp, 0);
}
vLastOrigin = ent->origin;
continue;
}
fCurLength += vDelta.length();
vTmp[0] = fCurLength;
VectorCopy(ent->origin, vTmp + 1);
if (ent->IsSubclassOfVehiclePoint()) {
pPath->Add(vTmp, static_cast<VehiclePoint*>(ent)->spawnflags);
} else {
pPath->Add(vTmp, 0);
}
vLastOrigin = ent->origin;
if (ent == se && i > 1) {
break;
}