From 229d0364d4a8b37beec8e9f4851da6be426533b5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 25 Oct 2023 07:40:55 -0400 Subject: [PATCH] Fixed lookup sides for 32-bit systems --- src/lua_maplib.c | 5 ++++- src/p_setup.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 7302c727a..2a02b1a24 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1243,6 +1243,9 @@ static int side_get(lua_State *L) return 1; case side_text: { + boolean isfrontside; + size_t sidei = side-sides; + if (udmf) { LUA_Deprecated(L, "(sidedef_t).text", "(sidedef_t).line.stringargs"); @@ -1250,7 +1253,7 @@ static int side_get(lua_State *L) return 1; } - boolean isfrontside = side->line->sidenum[0] == side-sides; + isfrontside = side->line->sidenum[0] == sidei; lua_pushstring(L, side->line->stringargs[isfrontside ? 0 : 1]); return 1; diff --git a/src/p_setup.c b/src/p_setup.c index 733a47792..effd2c368 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -4005,7 +4005,7 @@ static void P_LinkMapData(void) if (!seg->sidedef) CorruptMapError(va("P_LinkMapData: seg->sidedef is NULL " "(subsector %s, firstline is %d)", sizeu1(i), ss->firstline)); - if (seg->sidedef - sides < 0 || seg->sidedef - sides > (UINT32)numsides) + if (seg->sidedef - sides < 0 || sidei > numsides) CorruptMapError(va("P_LinkMapData: seg->sidedef refers to sidedef %s of %s " "(subsector %s, firstline is %d)", sizeu1(sidei), sizeu2(numsides), sizeu3(i), ss->firstline));