shithub: choc

Download patch

ref: 4e4f77f13ef73ad62dc96b3f9bcac7f01697196a
parent: 2d837ce8417f2babed52776a84eb3f4c00a0c0ad
author: Simon Howard <[email protected]>
date: Tue Sep 3 23:52:39 EDT 2013

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

--- a/src/d_loop.c
+++ b/src/d_loop.c
@@ -115,7 +115,13 @@
 
 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
 
 static int GetAdjustedTime(void)
@@ -346,6 +352,7 @@
 
     settings->consoleplayer = 0;
     settings->num_players = 1;
+    settings->player_classes[0] = player_class;
 
     //!
     // @category net
@@ -435,6 +442,8 @@
     // Call D_QuitNetGame on exit:
 
     I_AtExit(D_QuitNetGame, true);
+
+    player_class = connect_data->player_class;
 
 #ifdef FEATURE_MULTIPLAYER