Merge branch 'master' into signpost-cleanup

This commit is contained in:
lachwright 2019-11-23 07:05:45 +08:00
commit dea1ba6568
5 changed files with 24 additions and 10 deletions

View file

@ -1939,6 +1939,17 @@ static void Command_Map_f(void)
d = atoi(gametypename); d = atoi(gametypename);
if (d >= 0 && d < NUMGAMETYPES) if (d >= 0 && d < NUMGAMETYPES)
newgametype = d; newgametype = d;
else
{
CONS_Alert(CONS_ERROR,
"Gametype number %d is out of range. Use a number between"
" 0 and %d inclusive. ...Or just use the name. :v\n",
d,
NUMGAMETYPES-1);
Z_Free(realmapname);
Z_Free(mapname);
return;
}
} }
else else
{ {
@ -2054,7 +2065,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
lastgametype = gametype; lastgametype = gametype;
gametype = READUINT8(*cp); gametype = READUINT8(*cp);
if (gametype != lastgametype) if (gametype < 0 || gametype >= NUMGAMETYPES)
gametype = lastgametype;
else if (gametype != lastgametype)
D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype
skipprecutscene = ((flags & (1<<2)) != 0); skipprecutscene = ((flags & (1<<2)) != 0);

View file

@ -2805,12 +2805,12 @@ boolean P_SetupLevel(boolean skipprecip)
{ {
// Don't include these in the fade! // Don't include these in the fade!
char tx[64]; char tx[64];
V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to...")); V_DrawSmallString(1, 191, V_ALLOWLOWERCASE|V_TRANSLUCENT, M_GetText("Speeding off to..."));
snprintf(tx, 63, "%s%s%s", snprintf(tx, 63, "%s%s%s",
mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->lvlttl,
(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE", (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " Zone",
(mapheaderinfo[gamemap-1]->actnum > 0) ? va(", Act %d",mapheaderinfo[gamemap-1]->actnum) : ""); (mapheaderinfo[gamemap-1]->actnum > 0) ? va("%d",mapheaderinfo[gamemap-1]->actnum) : "");
V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx); V_DrawSmallString(1, 195, V_ALLOWLOWERCASE|V_TRANSLUCENT, tx);
I_UpdateNoVsync(); I_UpdateNoVsync();
} }

View file

@ -4030,7 +4030,8 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd)
{ {
player->pflags |= PF_ATTACKDOWN; player->pflags |= PF_ATTACKDOWN;
mo = P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0); mo = P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0);
P_InstaThrust(mo, player->mo->angle, ((mo->info->speed>>FRACBITS)*player->mo->scale) + player->speed); if (mo)
P_InstaThrust(mo, player->mo->angle, ((mo->info->speed>>FRACBITS)*player->mo->scale) + player->speed);
S_StartSound(player->mo, sfx_mario7); S_StartSound(player->mo, sfx_mario7);
P_SetWeaponDelay(player, TICRATE); // Short delay between fireballs so you can't spam them everywhere P_SetWeaponDelay(player, TICRATE); // Short delay between fireballs so you can't spam them everywhere
return; return;
@ -4051,8 +4052,8 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd)
mo = P_SpawnPlayerMissile(player->mo, MT_THROWNBOUNCE, MF2_BOUNCERING); mo = P_SpawnPlayerMissile(player->mo, MT_THROWNBOUNCE, MF2_BOUNCERING);
if (mo) if (mo)
mo->fuse = 3*TICRATE; // Bounce Ring time mo->fuse = 3*TICRATE; // Bounce Ring time
} }
// Rail ring // Rail ring
else if (player->currentweapon == WEP_RAIL && player->powers[pw_railring]) else if (player->currentweapon == WEP_RAIL && player->powers[pw_railring])

View file

@ -1335,7 +1335,7 @@ void ST_drawTitleCard(void)
V_DrawLevelTitle(lvlttlxpos - ttlscroll, 80, V_PERPLAYER, lvlttl); V_DrawLevelTitle(lvlttlxpos - ttlscroll, 80, V_PERPLAYER, lvlttl);
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
V_DrawLevelTitle(zonexpos + ttlscroll, 104, V_PERPLAYER, M_GetText("Zone")); V_DrawLevelTitle(zonexpos + ttlscroll, 104, V_PERPLAYER, M_GetText("Zone"));
V_DrawCenteredString(subttlxpos - ttlnumxpos, 128, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); V_DrawCenteredString(subttlxpos - ttlscroll, 135, V_PERPLAYER|V_ALLOWLOWERCASE, subttl);
lt_lasttic = lt_ticker; lt_lasttic = lt_ticker;

View file

@ -75,7 +75,7 @@ strcasestr (const char *s, const char *q)
if (!( (intptr_t)up|(intptr_t)lp )) if (!( (intptr_t)up|(intptr_t)lp ))
return 0; return 0;
if (!lp || up < lp) if (!lp || ( up && up < lp ))
{ {
ppa = &up; ppa = &up;
ppb = &lp; ppb = &lp;