From 69789a1dbebea49b74ec336a848caaa83b501115 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 18 Jun 2007 23:50:42 +0000 Subject: Add -iwad when joining a game, as well as when creating one (thanks MikeRS :-) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 916 --- setup/multiplayer.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/setup/multiplayer.c b/setup/multiplayer.c index 062afae9..e06fa6ab 100644 --- a/setup/multiplayer.c +++ b/setup/multiplayer.c @@ -155,6 +155,14 @@ static void AddExtraParameters(execute_context_t *exec) } } +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 @@ static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data)) 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 @@ static void DoJoinGame(void *unused1, void *unused2) 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(); -- cgit v1.2.3