diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 0daadfa45..2a2e87603 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -3527,7 +3527,7 @@ static void fgrouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) shy1 = y1+(shoffs>>15); if ((unsigned)shy1 >= SLOPALOOKUPSIZ-1) { - OSD_Printf("%s:%d: slopalookup[] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, sectnum); + OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum); return; } @@ -3542,10 +3542,15 @@ static void fgrouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) shy1 = y1+(shoffs>>15); shy2 = y2+(shoffs>>15); - if ((unsigned)shy1 >= SLOPALOOKUPSIZ || (unsigned)shy2 >= SLOPALOOKUPSIZ) + // Ridiculously steep gradient? + if ((unsigned)shy1 >= SLOPALOOKUPSIZ) { - // Ridiculously steep gradient? - OSD_Printf("%s:%d: slopalookup[] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, sectnum); + OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum); + goto next_most; + } + if ((unsigned)shy2 >= SLOPALOOKUPSIZ) + { + OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy2, sectnum); goto next_most; } @@ -3832,7 +3837,7 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) shy1 = y1+(shoffs>>15); if ((unsigned)shy1 >= SLOPALOOKUPSIZ - 1) { - OSD_Printf("%s:%d: slopalookup[] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, sectnum); + OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum); return; } @@ -3847,10 +3852,15 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) shy1 = y1+(shoffs>>15); shy2 = y2+(shoffs>>15); - if ((unsigned)shy1 >= SLOPALOOKUPSIZ || (unsigned)shy2 >= SLOPALOOKUPSIZ) + // Ridiculously steep gradient? + if ((unsigned)shy1 >= SLOPALOOKUPSIZ) { - // Ridiculously steep gradient? - OSD_Printf("%s:%d: slopalookup[] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, sectnum); + OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum); + goto next_most; + } + if ((unsigned)shy2 >= SLOPALOOKUPSIZ) + { + OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy2, sectnum); goto next_most; }