foxygit / doom Log in
commit 4e4f77f13ef73ad62dc96b3f9bcac7f01697196a
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Wed Sep 4 03:52:39 2013 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Wed Sep 4 03:52:39 2013 +0000

    Fix Hexen -class parameter when starting a single player game from the
    command line (thanks Alexandre Xavier).

    Subversion-branch: /branches/v2-branch
    Subversion-revision: 2634
---
 src/d_loop.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/d_loop.c b/src/d_loop.c
index 558d16b7..b68e2665 100644
--- a/src/d_loop.c
+++ b/src/d_loop.c
@@ -115,6 +115,12 @@ static loop_interface_t *loop_interface = NULL;

 static boolean local_playeringame[NET_MAXPLAYERS];

+// Requested player class "sent" to the server on connect.
+// If we are only doing a single player game then this needs to be remembered
+// and saved in the game settings.
+
+static int player_class;
+

 // 35 fps clock adjusted by offsetms milliseconds

@@ -346,6 +352,7 @@ void D_StartNetGame(net_gamesettings_t *settings,

     settings->consoleplayer = 0;
     settings->num_players = 1;
+    settings->player_classes[0] = player_class;

     //!
     // @category net
@@ -436,6 +443,8 @@ boolean D_InitNetGame(net_connect_data_t *connect_data)

     I_AtExit(D_QuitNetGame, true);

+    player_class = connect_data->player_class;
+
 #ifdef FEATURE_MULTIPLAYER

     //!