diff --git a/source/build/include/build.h b/source/build/include/build.h index 336e74551..b44fe99cc 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -445,7 +445,7 @@ inline void updatesector(int const x, int const y, sectortype** const sectp) { int sectno = *sectp? (*sectp) - sector : -1; updatesector(x, y, §no); - *sectp = §or[sectno]; + *sectp = sectno == -1? nullptr : §or[sectno]; } void updatesectorz(int32_t const x, int32_t const y, int32_t const z, int * const sectnum) ATTRIBUTE((nonnull(4)));