Mapster32/C++ build/non-Lua: probably fix a crash in showsectordata().

Reported in
http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__view__findpost__p__220722
I could not reproduce it, but it is thinkable that 'searchsector' could have
been out-of-sync with the 'sectnum' local. (For example, the former one could
have been -1, triggering the crash.)

git-svn-id: https://svn.eduke32.com/eduke32@5132 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-04-11 13:53:07 +00:00
parent 25402be9f2
commit f74b38bcd8

View file

@ -10188,12 +10188,11 @@ void printcoords16(int32_t posxe, int32_t posye, int16_t ange)
void showsectordata(int16_t sectnum, int16_t small) void showsectordata(int16_t sectnum, int16_t small)
{ {
sectortype *sec;
char snotbuf[80]; char snotbuf[80];
int32_t col=0; //,row = 0; int32_t col=0; //,row = 0;
int32_t color = small ? whitecol : editorcolors[11]; int32_t color = small ? whitecol : editorcolors[11];
sec = &sector[sectnum]; const sectortype *const sec = &sector[sectnum];
if (small) if (small)
{ {
@ -10218,7 +10217,7 @@ void showsectordata(int16_t sectnum, int16_t small)
{ {
int32_t xp=sec->ceilingxpanning, yp=sec->ceilingypanning; int32_t xp=sec->ceilingxpanning, yp=sec->ceilingypanning;
#ifdef YAX_ENABLE__COMPAT #ifdef YAX_ENABLE__COMPAT
if (yax_getbunch(searchsector, YAX_CEILING) >= 0) if (yax_getbunch(sectnum, YAX_CEILING) >= 0)
xp = yp = 0; xp = yp = 0;
#endif #endif
DOPRINT(56, "(X,Y)pan: %d, %d", xp, yp); DOPRINT(56, "(X,Y)pan: %d, %d", xp, yp);
@ -10239,7 +10238,7 @@ void showsectordata(int16_t sectnum, int16_t small)
{ {
int32_t xp=sec->floorxpanning, yp=sec->floorypanning; int32_t xp=sec->floorxpanning, yp=sec->floorypanning;
#ifdef YAX_ENABLE__COMPAT #ifdef YAX_ENABLE__COMPAT
if (yax_getbunch(searchsector, YAX_FLOOR) >= 0) if (yax_getbunch(sectnum, YAX_FLOOR) >= 0)
xp = yp = 0; xp = yp = 0;
#endif #endif
DOPRINT(56, "(X,Y)pan: %d, %d", xp, yp); DOPRINT(56, "(X,Y)pan: %d, %d", xp, yp);