shithub: choc

Download patch

ref: 69789a1dbebea49b74ec336a848caaa83b501115
parent: ad6ea294fe35a98c76a2b75a757006fd67efab5a
author: Simon Howard <fraggle@gmail.com>
date: Mon Jun 18 19:50:42 EDT 2007

Add -iwad when joining a game, as well as when creating one (thanks
MikeRS :-)

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 916

--- a/setup/multiplayer.c
+++ b/setup/multiplayer.c
@@ -155,6 +155,14 @@
     }
 }
 
+static void AddIWADParameter(execute_context_t *exec)
+{
+    if (iwadfile != NULL)
+    {
+        AddCmdLineParameter(exec, "-iwad %s", iwadfile);
+    }
+}
+
 static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))
 {
     execute_context_t *exec;
@@ -166,11 +174,7 @@
 
     AddExtraParameters(exec);
 
-    if (iwadfile != NULL)
-    {
-        AddCmdLineParameter(exec, "-iwad %s", iwadfile);
-    }
-
+    AddIWADParameter(exec);
     AddCmdLineParameter(exec, "-server");
     AddCmdLineParameter(exec, "-skill %i", skill + 1);
 
@@ -555,7 +559,12 @@
     exec = NewExecuteContext();
 
     AddCmdLineParameter(exec, "-connect %s", connect_address);
+
+    // Extra parameters come first, so that they can be used to override
+    // the other parameters.
+
     AddExtraParameters(exec);
+    AddIWADParameter(exec);
     AddWADs(exec);
 
     TXT_Shutdown();