mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	D_ClearState, G_EndGame, G_GameEndTicker: Move netgame-specific server looping out of the general state-clearing function, for sanity's sake.
This commit is contained in:
		
							parent
							
								
									2d5d5343b1
								
							
						
					
					
						commit
						87ee91638e
					
				
					 3 changed files with 26 additions and 25 deletions
				
			
		
							
								
								
									
										20
									
								
								src/d_main.c
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								src/d_main.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -923,23 +923,6 @@ void D_ClearState(void)
 | 
			
		|||
 | 
			
		||||
	S_StopMusic();
 | 
			
		||||
 | 
			
		||||
	if (netgame)
 | 
			
		||||
	{
 | 
			
		||||
		G_SetGamestate(GS_WAITINGPLAYERS); // hack to prevent a command repeat
 | 
			
		||||
 | 
			
		||||
		if (server)
 | 
			
		||||
		{
 | 
			
		||||
			i = G_GetFirstMapOfGametype(gametype)+1;
 | 
			
		||||
 | 
			
		||||
			if (i > nummapheaders)
 | 
			
		||||
				I_Error("D_ClearState: No valid map ID found!?");
 | 
			
		||||
 | 
			
		||||
			COM_BufAddText(va("map %s\n", G_BuildMapName(i)));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// okay, stop now
 | 
			
		||||
	// (otherwise the game still thinks we're playing!)
 | 
			
		||||
	SV_StopServer();
 | 
			
		||||
| 
						 | 
				
			
			@ -995,9 +978,6 @@ void D_ClearState(void)
 | 
			
		|||
void D_StartTitle(void)
 | 
			
		||||
{
 | 
			
		||||
	D_ClearState();
 | 
			
		||||
	if (netgame)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	F_StartTitleScreen();
 | 
			
		||||
	M_ClearMenus(false);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1638,9 +1638,14 @@ void F_GameEndDrawer(void)
 | 
			
		|||
void F_GameEndTicker(void)
 | 
			
		||||
{
 | 
			
		||||
	if (timetonext > 0)
 | 
			
		||||
	{
 | 
			
		||||
		timetonext--;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		D_StartTitle();
 | 
			
		||||
	{
 | 
			
		||||
		nextmap = NEXTMAP_TITLE;
 | 
			
		||||
		G_EndGame();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										24
									
								
								src/g_game.c
									
										
									
									
									
								
							
							
						
						
									
										24
									
								
								src/g_game.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -4178,12 +4178,28 @@ void G_EndGame(void)
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// direct or competitive multiplayer, so go back to title screen.
 | 
			
		||||
	D_ClearState();
 | 
			
		||||
	if (!netgame)
 | 
			
		||||
	// In a netgame, don't unwittingly boot everyone.
 | 
			
		||||
	if (netgame)
 | 
			
		||||
	{
 | 
			
		||||
		M_StartControlPanel();
 | 
			
		||||
		S_StopMusic();
 | 
			
		||||
		G_SetGamestate(GS_WAITINGPLAYERS); // hack to prevent a command repeat
 | 
			
		||||
 | 
			
		||||
		if (server)
 | 
			
		||||
		{
 | 
			
		||||
			UINT16 map = G_GetFirstMapOfGametype(gametype)+1;
 | 
			
		||||
 | 
			
		||||
			if (map > nummapheaders)
 | 
			
		||||
				I_Error("G_EndGame: No valid map ID found!?");
 | 
			
		||||
 | 
			
		||||
			COM_BufAddText(va("map %s\n", G_BuildMapName(map)));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Time to return to the menu.
 | 
			
		||||
	D_ClearState();
 | 
			
		||||
	M_StartControlPanel();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue