Merge branch 'master' into next

This commit is contained in:
Alam Ed Arias 2018-05-08 21:26:26 -04:00
commit 6be0f90fbe
7 changed files with 64 additions and 27 deletions

View file

@ -2244,7 +2244,7 @@ static void Command_connect(void)
// Assume we connect directly. // Assume we connect directly.
boolean viams = false; boolean viams = false;
if (COM_Argc() < 2) if (COM_Argc() < 2 || *COM_Argv(1) == 0)
{ {
CONS_Printf(M_GetText( CONS_Printf(M_GetText(
"Connect <serveraddress> (port): connect to a server\n" "Connect <serveraddress> (port): connect to a server\n"

View file

@ -1068,7 +1068,7 @@ void D_SRB2Main(void)
// add any files specified on the command line with -file wadfile // add any files specified on the command line with -file wadfile
// to the wad list // to the wad list
if (!(M_CheckParm("-connect"))) if (!(M_CheckParm("-connect") && !M_CheckParm("-server")))
{ {
if (M_CheckParm("-file")) if (M_CheckParm("-file"))
{ {
@ -1224,7 +1224,15 @@ void D_SRB2Main(void)
R_Init(); R_Init();
// setting up sound // setting up sound
CONS_Printf("S_Init(): Setting up sound.\n"); if (dedicated)
{
nosound = true;
nomidimusic = nodigimusic = true;
}
else
{
CONS_Printf("S_Init(): Setting up sound.\n");
}
if (M_CheckParm("-nosound")) if (M_CheckParm("-nosound"))
nosound = true; nosound = true;
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
@ -1323,7 +1331,7 @@ void D_SRB2Main(void)
ultimatemode = true; ultimatemode = true;
} }
if (autostart || netgame || M_CheckParm("+connect") || M_CheckParm("-connect")) if (autostart || netgame)
{ {
gameaction = ga_nothing; gameaction = ga_nothing;
@ -1361,8 +1369,7 @@ void D_SRB2Main(void)
} }
} }
if (server && !M_CheckParm("+map") && !M_CheckParm("+connect") if (server && !M_CheckParm("+map"))
&& !M_CheckParm("-connect"))
{ {
// Prevent warping to nonexistent levels // Prevent warping to nonexistent levels
if (W_CheckNumForName(G_BuildMapName(pstartmap)) == LUMPERROR) if (W_CheckNumForName(G_BuildMapName(pstartmap)) == LUMPERROR)

View file

@ -990,19 +990,41 @@ filestatus_t checkfilemd5(char *filename, const UINT8 *wantedmd5sum)
return FS_FOUND; // will never happen, but makes the compiler shut up return FS_FOUND; // will never happen, but makes the compiler shut up
} }
// Rewritten by Monster Iestyn to be less stupid
// Note: if completepath is true, "filename" is modified, but only if FS_FOUND is going to be returned
// (Don't worry about WinCE's version of filesearch, nobody cares about that OS anymore)
filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean completepath) filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean completepath)
{ {
filestatus_t homecheck = filesearch(filename, srb2home, wantedmd5sum, false, 10); filestatus_t homecheck; // store result of last file search
if (homecheck == FS_FOUND) boolean badmd5 = false; // store whether md5 was bad from either of the first two searches (if nothing was found in the third)
return filesearch(filename, srb2home, wantedmd5sum, completepath, 10);
homecheck = filesearch(filename, srb2path, wantedmd5sum, false, 10); // first, check SRB2's "home" directory
if (homecheck == FS_FOUND) homecheck = filesearch(filename, srb2home, wantedmd5sum, completepath, 10);
return filesearch(filename, srb2path, wantedmd5sum, completepath, 10);
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
return FS_FOUND;
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
badmd5 = true;
// if not found at all, just move on without doing anything
// next, check SRB2's "path" directory
homecheck = filesearch(filename, srb2path, wantedmd5sum, completepath, 10);
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
return FS_FOUND;
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
badmd5 = true;
// if not found at all, just move on without doing anything
// finally check "." directory
#ifdef _arch_dreamcast #ifdef _arch_dreamcast
return filesearch(filename, "/cd", wantedmd5sum, completepath, 10); homecheck = filesearch(filename, "/cd", wantedmd5sum, completepath, 10);
#else #else
return filesearch(filename, ".", wantedmd5sum, completepath, 10); homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10);
#endif #endif
if (homecheck != FS_NOTFOUND) // if not found this time, fall back on the below return statement
return homecheck; // otherwise return the result we got
return (badmd5 ? FS_MD5SUMBAD : FS_NOTFOUND); // md5 sum bad or file not found
} }

View file

@ -3588,7 +3588,8 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
unlocktriggers = 0; unlocktriggers = 0;
// clear itemfinder, just in case // clear itemfinder, just in case
CV_StealthSetValue(&cv_itemfinder, 0); if (!dedicated) // except in dedicated servers, where it is not registered and can actually I_Error debug builds
CV_StealthSetValue(&cv_itemfinder, 0);
} }
// internal game map // internal game map

View file

@ -6295,6 +6295,13 @@ static void M_DrawConnectIPMenu(void)
static void M_ConnectIP(INT32 choice) static void M_ConnectIP(INT32 choice)
{ {
(void)choice; (void)choice;
if (*setupm_ip == 0)
{
M_StartMessage("You must specify an IP address.\n", NULL, MM_NOTHING);
return;
}
COM_BufAddText(va("connect \"%s\"\n", setupm_ip)); COM_BufAddText(va("connect \"%s\"\n", setupm_ip));
// A little "please wait" message. // A little "please wait" message.

View file

@ -2565,6 +2565,7 @@ boolean P_SetupLevel(boolean skipprecip)
{ {
tic_t starttime = I_GetTime(); tic_t starttime = I_GetTime();
tic_t endtime = starttime + (3*TICRATE)/2; tic_t endtime = starttime + (3*TICRATE)/2;
tic_t nowtime;
S_StartSound(NULL, sfx_s3kaf); S_StartSound(NULL, sfx_s3kaf);
@ -2574,9 +2575,17 @@ boolean P_SetupLevel(boolean skipprecip)
F_WipeEndScreen(); F_WipeEndScreen();
F_RunWipe(wipedefs[wipe_speclevel_towhite], false); F_RunWipe(wipedefs[wipe_speclevel_towhite], false);
nowtime = lastwipetic;
// Hold on white for extra effect. // Hold on white for extra effect.
while (I_GetTime() < endtime) while (nowtime < endtime)
I_Sleep(); {
// wait loop
while (!((nowtime = I_GetTime()) - lastwipetic))
I_Sleep();
lastwipetic = nowtime;
if (moviemode) // make sure we save frames for the white hold too
M_SaveFrame();
}
ranspecialwipe = 1; ranspecialwipe = 1;
} }

View file

@ -1180,12 +1180,6 @@ void I_StartupSound(void)
audio.callback = I_UpdateStream; audio.callback = I_UpdateStream;
audio.userdata = &localdata; audio.userdata = &localdata;
if (dedicated)
{
nosound = nomidimusic = nodigimusic = true;
return;
}
// Configure sound device // Configure sound device
CONS_Printf("I_StartupSound:\n"); CONS_Printf("I_StartupSound:\n");
@ -1481,9 +1475,6 @@ void I_InitMusic(void)
I_AddExitFunc(I_ShutdownGMEMusic); I_AddExitFunc(I_ShutdownGMEMusic);
#endif #endif
if ((nomidimusic && nodigimusic) || dedicated)
return;
#ifdef HAVE_MIXER #ifdef HAVE_MIXER
MIX_VERSION(&MIXcompiled) MIX_VERSION(&MIXcompiled)
MIXlinked = Mix_Linked_Version(); MIXlinked = Mix_Linked_Version();