diff --git a/source/core/updatesector.h b/source/core/updatesector.h index 460072cea..cb1cc713c 100644 --- a/source/core/updatesector.h +++ b/source/core/updatesector.h @@ -42,7 +42,7 @@ void DoUpdateSector(double x, double y, double z, int* sectnum, double maxDistan { double maxDistSq = maxDistance * maxDistance; - if (sectnum) + if (validSectorIndex(sectnum)) { if (checker(x, y, z, §or[*sectnum])) return; @@ -66,8 +66,8 @@ void DoUpdateSector(double x, double y, double z, int* sectnum, double maxDistan } iter++; } - *sectnum = -1; } + *sectnum = -1; } template