Remove a useless and confusing test

If min_sector could be anything but UNKNOWN_SECTOR out of the loop, the "return 0" would be wrong.
This commit is contained in:
Alayan-stk-2 2019-07-16 12:04:03 +02:00 committed by GitHub
parent 5e9b3d2c4e
commit b95c3233d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -750,16 +750,13 @@ int Graph::findOutOfRoadSector(const Vec3& xyz, const int curr_sector,
}
current_sector = next_sector;
} // for j
// Leave in phase 0 if any sector was found.
// If any sector was found after a phase, return it.
if(min_sector!=UNKNOWN_SECTOR)
return min_sector;
} // phase
if(min_sector==UNKNOWN_SECTOR)
{
Log::warn("Graph", "unknown sector found.");
}
// Avoid crashing in TrackSector
// We can only reach this point if min_sector==UNKNOWN_SECTOR
Log::warn("Graph", "unknown sector found.");
return 0;
} // findOutOfRoadSector