Merge branch 'next' of http://git.magicalgirl.moe/STJr/SRB2.git into diagonal-spring-rings-tweak

This commit is contained in:
Monster Iestyn 2016-01-29 19:40:04 +00:00
commit 7d603c320b
5 changed files with 20 additions and 20 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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