From 0688ecda7a802723ae64ab516cfe6508d9890ec7 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 11 Dec 2010 00:10:10 +0000 Subject: Rearrange single player init to always use net_gamesettings_t structure. Subversion-branch: /branches/raven-branch Subversion-revision: 2216 --- src/doom/d_net.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'src/doom') diff --git a/src/doom/d_net.c b/src/doom/d_net.c index 70359ebd..93a48b41 100644 --- a/src/doom/d_net.c +++ b/src/doom/d_net.c @@ -337,9 +337,6 @@ static void LoadGameSettings(net_gamesettings_t *settings) printf("Syncing netgames like Vanilla Doom.\n"); } - netgame = true; - autostart = true; - if (!drone) { consoleplayer = settings->consoleplayer; @@ -439,27 +436,14 @@ static void SaveGameSettings(net_gamesettings_t *settings, connect_data->lowres_turn = settings->lowres_turn; } -void D_InitSinglePlayerGame(void) +void D_InitSinglePlayerGame(net_gamesettings_t *settings) { - int i; - // default values for single player - consoleplayer = 0; - netgame = false; - ticdup = 1; - extratics = 1; - lowres_turn = false; - offsetms = 0; - - for (i=0; iconsoleplayer = 0; + settings->num_players = 1; - playeringame[0] = true; + netgame = false; //! // @category net @@ -609,6 +593,9 @@ void D_CheckNetGame (void) net_connect_data_t connect_data; net_gamesettings_t settings; + offsetms = 0; + recvtic = 0; + // Call D_QuitNetGame on exit I_AtExit(D_QuitNetGame, true); @@ -617,13 +604,16 @@ void D_CheckNetGame (void) if (D_InitNetGame(&connect_data, &settings)) { - LoadGameSettings(&settings); + netgame = true; + autostart = true; } else { - D_InitSinglePlayerGame(); + D_InitSinglePlayerGame(&settings); } + LoadGameSettings(&settings); + DEH_printf("startskill %i deathmatch: %i startmap: %i startepisode: %i\n", startskill, deathmatch, startmap, startepisode); -- cgit v1.2.3