From c33d20acff6b712acc293bc97327b3021786a184 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 21 Jan 2016 13:50:05 -0500 Subject: [PATCH 1/4] whitespace cleanup --- src/r_bsp.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index badf8bda..c547713b 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -935,14 +935,14 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = NULL; ffloor[numffloors].polyobj = NULL; - - floorcenterz = + + floorcenterz = #ifdef ESLOPE frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) : #endif frontsector->floorheight; - - ceilingcenterz = + + ceilingcenterz = #ifdef ESLOPE frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) : #endif @@ -953,8 +953,8 @@ static void R_Subsector(size_t num) *rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) : #endif *rover->bottomheight; - - planecenterz = + + planecenterz = #ifdef ESLOPE *rover->b_slope ? P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) : #endif @@ -966,7 +966,7 @@ static void R_Subsector(size_t num) { light = R_GetPlaneLight(frontsector, planecenterz, viewz < *rover->bottomheight); - + ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic, *frontsector->lightlist[light].lightlevel, *rover->bottomxoffs, *rover->bottomyoffs, *rover->bottomangle, frontsector->lightlist[light].extra_colormap, rover @@ -1002,8 +1002,8 @@ static void R_Subsector(size_t num) *rover->t_slope ? P_GetZAt(*rover->t_slope, viewx, viewy) : #endif *rover->topheight; - - planecenterz = + + planecenterz = #ifdef ESLOPE *rover->t_slope ? P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) : #endif @@ -1014,7 +1014,7 @@ static void R_Subsector(size_t num) || (viewz < heightcheck && (rover->flags & FF_BOTHPLANES)))) { light = R_GetPlaneLight(frontsector, planecenterz, viewz < *rover->topheight); - + ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic, *frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle, frontsector->lightlist[light].extra_colormap, rover From 674ff5115392fea76bd757e39d6312924f70739d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 21 Jan 2016 20:27:35 +0000 Subject: [PATCH 2/4] Fix shadowing in mapheaderinfo_get --- src/lua_maplib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 6f28997a..38920c22 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1217,11 +1217,11 @@ static int mapheaderinfo_get(lua_State *L) else { // Read custom vars now // (note: don't include the "LUA." in your lua scripts!) - UINT8 i = 0; - for (;i < header->numCustomOptions && !fastcmp(field, header->customopts[i].option); ++i); + UINT8 j = 0; + for (;j < header->numCustomOptions && !fastcmp(field, header->customopts[j].option); ++j); - if(i < header->numCustomOptions) - lua_pushstring(L, header->customopts[i].value); + if(j < header->numCustomOptions) + lua_pushstring(L, header->customopts[j].value); else lua_pushnil(L); } From 80fb282334435ff7ee566e4ff08e46d4833b2b2a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 23 Jan 2016 18:59:17 +0000 Subject: [PATCH 3/4] Fixed math for calculating current texture in texture animations --- src/p_spec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index cac822ac..81994d46 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4671,11 +4671,11 @@ void P_UpdateSpecials(void) // ANIMATE TEXTURES for (anim = anims; anim < lastanim; anim++) { - for (i = anim->basepic; i < anim->basepic + anim->numpics; i++) + for (i = 0; i < anim->numpics; i++) { pic = anim->basepic + ((leveltime/anim->speed + i) % anim->numpics); if (anim->istexture) - texturetranslation[i] = pic; + texturetranslation[anim->basepic+i] = pic; } } From d76e21b54660c2efec99384538ed90b28eb513e3 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 28 Jan 2016 08:15:34 -0800 Subject: [PATCH 4/4] fix bind out of bounds / keystring misreading --- src/console.c | 2 +- src/g_input.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/console.c b/src/console.c index e77c400b..fcac0e6d 100644 --- a/src/console.c +++ b/src/console.c @@ -202,7 +202,7 @@ static void CONS_Bind_f(void) } key = G_KeyStringtoNum(COM_Argv(1)); - if (!key) + if (key <= 0 || key >= NUMINPUTS) { CONS_Alert(CONS_NOTICE, M_GetText("Invalid key name\n")); return; diff --git a/src/g_input.c b/src/g_input.c index f12ddb71..79e6fb94 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -1042,13 +1042,13 @@ INT32 G_KeyStringtoNum(const char *keystr) if (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z') return keystr[0]; + if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9') + return atoi(&keystr[3]); + for (j = 0; j < NUMKEYNAMES; j++) if (!stricmp(keynames[j].name, keystr)) return keynames[j].keynum; - if (strlen(keystr) > 3) - return atoi(&keystr[3]); - return 0; }