Commits

Torr_Samaho committed dcd9a35

Fixed: The internal server browser tried to connect to servers even though the necessary wads were not loaded. Now it refuses to connect and lists the missing wads instead.

  • Participants
  • Parent commits a2066b5

Comments (0)

Files changed (2)

docs/zandronum-history.txt

 -	- Fixed: If a player respawned with a console, chat or lag icon above his head, the icon vanished. [Torr Samaho]
 -	- Fixed: A_M_CheckAttack and A_M_BFGSound would cause desyncs. [Dusk]
 -	- Fixed: In A_M_Punch, the server didn't inform the clients about the changed angle. [Torr Samaho]
+-	- Fixed: The internal server browser tried to connect to servers even though the necessary wads were not loaded. Now it refuses to connect and lists the missing wads instead. [Torr Samaho]
 !	- sv_coop_damagefactor is not archived in the config file anymore, but reset to its default value when the game starts. [Torr Samaho]
 
 

src/m_options.cpp

 		ULONG	ulIdx;
 		bool	bNeedToLoadWads = false;
 		FString	WadList;
+		FString	MissingWadList;
 
 		// If the server uses a PWAD, make sure we have it loaded. If not, ask the user
 		// if he'd like to join the server anyway.
 			if ( ulIdx + 1 < static_cast<unsigned> (BROWSER_GetNumPWADs( g_lSelectedServer )))
 				WadList += " ";
 
-			if ( Wads.CheckIfWadLoaded( BROWSER_GetPWADName( g_lSelectedServer, ulIdx )) == false )
+			if ( Wads.CheckIfWadLoaded( BROWSER_GetPWADName( g_lSelectedServer, ulIdx )) == -1 )
 			{
 				// A needed wad hasn't bee loaded! Signify that we'll need to load wads.
 				bNeedToLoadWads = true;
+				// [BB] Save the wads we are missing so that we can print a meaningful error message.
+				MissingWadList += BROWSER_GetPWADName( g_lSelectedServer, ulIdx );
+				MissingWadList += "\n";
 			}
 		}
 
 		// Check if we need to load up PWADs before we join the server.
 		if ( bNeedToLoadWads )
 		{
+			I_Error ( "Can't connect to \"%s\". You don't have the following wads loaded:\n%s\nNote: It is recommended to use Doomseeker or IDE to join servers.", BROWSER_GetHostName ( g_lSelectedServer ), MissingWadList.GetChars() );
+
 			gamestate = GS_FULLCONSOLE;
 			if ( 0 )//D_LoadWads( szWadList ))
 			{