Merge branch 'next' into public_next

This commit is contained in:
Alam Ed Arias 2016-08-07 23:27:40 -04:00
commit ce129c28c2
3 changed files with 12 additions and 6 deletions

View file

@ -1060,10 +1060,11 @@ void D_SRB2Main(void)
if (M_CheckParm("-warp") && M_IsNextParm())
{
const char *word = M_GetNextParm();
if (fastncmp(word, "MAP", 3))
char ch; // use this with sscanf to catch non-digits with
if (fastncmp(word, "MAP", 3)) // MAPxx name
pstartmap = M_MapNumber(word[3], word[4]);
else
pstartmap = atoi(word);
else if (sscanf(word, "%d%c", &pstartmap, &ch) != 1) // a plain number
I_Error("Cannot warp to map %s (invalid map name)\n", word);
// Don't check if lump exists just yet because the wads haven't been loaded!
// Just do a basic range check here.
if (pstartmap < 1 || pstartmap > NUMMAPS)

View file

@ -1188,7 +1188,12 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
{
start++;
while (lines[start].special != special)
// This redundant check stops the compiler from complaining about function expansion
// elsewhere for some reason and everything is awful
if (start >= (INT32)numlines)
return -1;
while (start < (INT32)numlines && lines[start].special != special)
start++;
if (start >= (INT32)numlines)

View file

@ -280,7 +280,7 @@ static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef,
{
case 0xff:
// no rotations were found for that frame at all
I_Error("R_AddSingleSpriteDef: No patches found for %s frame %c", sprname, R_Frame2Char(frame));
I_Error("R_AddSingleSpriteDef: No patches found for %.4s frame %c", sprname, R_Frame2Char(frame));
break;
case 0:
@ -293,7 +293,7 @@ static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef,
// we test the patch lump, or the id lump whatever
// if it was not loaded the two are LUMPERROR
if (sprtemp[frame].lumppat[rotation] == LUMPERROR)
I_Error("R_AddSingleSpriteDef: Sprite %s frame %c is missing rotations",
I_Error("R_AddSingleSpriteDef: Sprite %.4s frame %c is missing rotations",
sprname, R_Frame2Char(frame));
break;
}