- refactored the exit calls out of the networking code
These ones were particularly bad examples of misusing the exit handlers by temporarily installing one themselves and then calling exit to clean stuff up. Now they just return an error code to D_DoomMain to perform a regular exit.
This commit is contained in:
parent
96006eb94f
commit
0a611e1992
4 changed files with 35 additions and 28 deletions
|
|
@ -1653,7 +1653,7 @@ static void SendSetup (uint32_t playersdetected[MAXNETNODES], uint8_t gotsetup[M
|
|||
// Works out player numbers among the net participants
|
||||
//
|
||||
|
||||
void D_CheckNetGame (void)
|
||||
bool D_CheckNetGame (void)
|
||||
{
|
||||
const char *v;
|
||||
int i;
|
||||
|
|
@ -1674,8 +1674,13 @@ void D_CheckNetGame (void)
|
|||
"\nIf the game is running well below expected speeds, use netmode 0 (P2P) instead.\n");
|
||||
}
|
||||
|
||||
int result = I_InitNetwork ();
|
||||
// I_InitNetwork sets doomcom and netgame
|
||||
if (I_InitNetwork ())
|
||||
if (result == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (result > 0)
|
||||
{
|
||||
// For now, stop auto selecting PacketServer, as it's more likely to cause confusion.
|
||||
//NetMode = NET_PacketServer;
|
||||
|
|
@ -1739,6 +1744,8 @@ void D_CheckNetGame (void)
|
|||
|
||||
if (!batchrun) Printf ("player %i of %i (%i nodes)\n",
|
||||
consoleplayer+1, doomcom.numplayers, doomcom.numnodes);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue