Merge remote-tracking branch 'remotes/pub/master' into next

This commit is contained in:
wolfy852 2019-04-26 05:42:27 -05:00
commit 690a495d9b
7 changed files with 43 additions and 46 deletions

View file

@ -167,7 +167,7 @@ ticcmd_t netcmds[BACKUPTICS][MAXPLAYERS];
static textcmdtic_t *textcmds[TEXTCMD_HASH_SIZE] = {NULL}; static textcmdtic_t *textcmds[TEXTCMD_HASH_SIZE] = {NULL};
consvar_t cv_showjoinaddress = {"showjoinaddress", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_showjoinaddress = {"showjoinaddress", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t playbackspeed_cons_t[] = {{1, "MIN"}, {10, "MAX"}, {0, NULL}}; static CV_PossibleValue_t playbackspeed_cons_t[] = {{1, "MIN"}, {10, "MAX"}, {0, NULL}};
consvar_t cv_playbackspeed = {"playbackspeed", "1", 0, playbackspeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_playbackspeed = {"playbackspeed", "1", 0, playbackspeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -1451,33 +1451,13 @@ static void SV_SendPlayerInfo(INT32 node)
continue; continue;
} }
netbuffer->u.playerinfo[i].node = (UINT8)playernode[i]; netbuffer->u.playerinfo[i].node = i;
strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1); strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1);
netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0'; netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0';
//fetch IP address //fetch IP address
{ //No, don't do that, you fuckface.
const char *claddress; memset(netbuffer->u.playerinfo[i].address, 0, 4);
UINT32 numericaddress[4];
memset(netbuffer->u.playerinfo[i].address, 0, 4);
if (playernode[i] == 0)
{
//127.0.0.1
netbuffer->u.playerinfo[i].address[0] = 127;
netbuffer->u.playerinfo[i].address[3] = 1;
}
else if (playernode[i] > 0 && I_GetNodeAddress && (claddress = I_GetNodeAddress(playernode[i])) != NULL)
{
if (sscanf(claddress, "%d.%d.%d.%d", &numericaddress[0], &numericaddress[1], &numericaddress[2], &numericaddress[3]) < 4)
goto badaddress;
netbuffer->u.playerinfo[i].address[0] = (UINT8)numericaddress[0];
netbuffer->u.playerinfo[i].address[1] = (UINT8)numericaddress[1];
netbuffer->u.playerinfo[i].address[2] = (UINT8)numericaddress[2];
netbuffer->u.playerinfo[i].address[3] = (UINT8)numericaddress[3];
}
}
badaddress:
if (G_GametypeHasTeams()) if (G_GametypeHasTeams())
{ {

View file

@ -1390,10 +1390,9 @@ void D_SRB2Main(void)
midi_disabled = true; midi_disabled = true;
#endif #endif
} }
if (M_CheckParm("-nosound")) if (M_CheckParm("-noaudio")) // combines -nosound and -nomusic
sound_disabled = true;
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
{ {
sound_disabled = true;
digital_disabled = true; digital_disabled = true;
#ifndef NO_MIDI #ifndef NO_MIDI
midi_disabled = true; midi_disabled = true;
@ -1401,12 +1400,24 @@ void D_SRB2Main(void)
} }
else else
{ {
if (M_CheckParm("-nosound"))
sound_disabled = true;
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
{
digital_disabled = true;
#ifndef NO_MIDI #ifndef NO_MIDI
if (M_CheckParm("-nomidimusic")) midi_disabled = true;
midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
#endif #endif
if (M_CheckParm("-nodigmusic")) }
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound else
{
#ifndef NO_MIDI
if (M_CheckParm("-nomidimusic"))
midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
#endif
if (M_CheckParm("-nodigmusic"))
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
}
} }
if (!( sound_disabled && digital_disabled if (!( sound_disabled && digital_disabled
#ifndef NO_MIDI #ifndef NO_MIDI

View file

@ -1239,6 +1239,8 @@ void G_ClearAllControlKeys(void)
{ {
G_ClearControlKeys(gamecontrol, i); G_ClearControlKeys(gamecontrol, i);
G_ClearControlKeys(gamecontrolbis, i); G_ClearControlKeys(gamecontrolbis, i);
G_ClearControlKeys(gamecontrol3, i);
G_ClearControlKeys(gamecontrol4, i);
} }
} }

View file

@ -7456,7 +7456,10 @@ static void M_ConnectMenu(INT32 choice)
// first page of servers // first page of servers
serverlistpage = 0; serverlistpage = 0;
M_SetupNextMenu(&MP_ConnectDef); if (ms_RoomId < 0)
M_RoomMenu(0); // Select a room instead of staring at an empty list
else
M_SetupNextMenu(&MP_ConnectDef);
itemOn = 0; itemOn = 0;
M_Refresh(0); M_Refresh(0);
} }
@ -7529,7 +7532,15 @@ static void M_ChooseRoom(INT32 choice)
} }
serverlistpage = 0; serverlistpage = 0;
M_SetupNextMenu(currentMenu->prevMenu); /*
We were on the Multiplayer menu? That means that we must have been trying to
view the server browser, but we hadn't selected a room yet. So we need to go
to the browser next, not back there.
*/
if (currentMenu->prevMenu == &MP_MainDef)
M_SetupNextMenu(&MP_ConnectDef);
else
M_SetupNextMenu(currentMenu->prevMenu);
if (currentMenu == &MP_ConnectDef) if (currentMenu == &MP_ConnectDef)
M_Refresh(0); M_Refresh(0);
} }

View file

@ -1796,7 +1796,7 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber)
} }
} }
// Someone seriously wants infinite draw distance for precipitation? // no, no infinite draw distance for precipitation. this option at zero is supposed to turn it off
if ((limit_dist = (fixed_t)cv_drawdist_precip.value << FRACBITS)) if ((limit_dist = (fixed_t)cv_drawdist_precip.value << FRACBITS))
{ {
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext) for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
@ -1812,13 +1812,6 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber)
R_ProjectPrecipitationSprite(precipthing); R_ProjectPrecipitationSprite(precipthing);
} }
} }
else
{
// Draw everything in sector, no checks
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
if (!(precipthing->precipflags & PCF_INVISIBLE))
R_ProjectPrecipitationSprite(precipthing);
}
} }
// //

View file

@ -2182,7 +2182,7 @@ static void Command_RestartAudio_f(void)
void GameSounds_OnChange(void) void GameSounds_OnChange(void)
{ {
if (M_CheckParm("-nosound")) if (M_CheckParm("-nosound") || M_CheckParm("-noaudio"))
return; return;
if (sound_disabled) if (sound_disabled)
@ -2196,7 +2196,7 @@ void GameSounds_OnChange(void)
void GameDigiMusic_OnChange(void) void GameDigiMusic_OnChange(void)
{ {
if (M_CheckParm("-nomusic")) if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
return; return;
else if (M_CheckParm("-nodigmusic")) else if (M_CheckParm("-nodigmusic"))
return; return;
@ -2239,7 +2239,7 @@ void GameDigiMusic_OnChange(void)
#ifndef NO_MIDI #ifndef NO_MIDI
void GameMIDIMusic_OnChange(void) void GameMIDIMusic_OnChange(void)
{ {
if (M_CheckParm("-nomusic")) if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
return; return;
else if (M_CheckParm("-nomidimusic")) else if (M_CheckParm("-nomidimusic"))
return; return;

View file

@ -1505,11 +1505,11 @@ void Y_EndVote(void)
// //
static void Y_UnloadVoteData(void) static void Y_UnloadVoteData(void)
{ {
voteclient.loaded = false;
if (rendermode != render_soft) if (rendermode != render_soft)
return; return;
voteclient.loaded = false;
UNLOAD(widebgpatch); UNLOAD(widebgpatch);
UNLOAD(bgpatch); UNLOAD(bgpatch);
UNLOAD(cursor); UNLOAD(cursor);