summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2010-12-11 00:10:10 +0000
committerSimon Howard2010-12-11 00:10:10 +0000
commit0688ecda7a802723ae64ab516cfe6508d9890ec7 (patch)
tree3a4954cdf71010ad287fcaffa4596229607e22c6
parentd1a3967194323b08227b20822acedb837e05281a (diff)
downloadchocolate-doom-0688ecda7a802723ae64ab516cfe6508d9890ec7.tar.gz
chocolate-doom-0688ecda7a802723ae64ab516cfe6508d9890ec7.tar.bz2
chocolate-doom-0688ecda7a802723ae64ab516cfe6508d9890ec7.zip
Rearrange single player init to always use net_gamesettings_t structure.
Subversion-branch: /branches/raven-branch Subversion-revision: 2216
-rw-r--r--src/doom/d_net.c34
1 files changed, 12 insertions, 22 deletions
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; i<MAXPLAYERS; i++)
- {
- playeringame[i] = false;
- }
-
- recvtic = 0;
+ settings->consoleplayer = 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);