summaryrefslogtreecommitdiff
path: root/src/d_iwad.c
diff options
context:
space:
mode:
authorSimon Howard2014-04-19 03:32:38 -0400
committerSimon Howard2014-04-19 03:32:38 -0400
commit48e96443151db631e1153d459e850c49a96ccb29 (patch)
treec6a8df63662657dc92eeb73c0112f1190d3b21a7 /src/d_iwad.c
parentb86a383c6fdc394ef995a8e88324c89408f01c05 (diff)
downloadchocolate-doom-48e96443151db631e1153d459e850c49a96ccb29.tar.gz
chocolate-doom-48e96443151db631e1153d459e850c49a96ccb29.tar.bz2
chocolate-doom-48e96443151db631e1153d459e850c49a96ccb29.zip
Exit with error on startup if using the wrong IWAD.
Having multiple binaries can cause some confusion - some users try to run chocolate-doom with hexen.wad, thinking it is supported. Add a startup check that makes sure the user is not trying to start the game using the wrong IWAD file for the binary being run. This fixes #382.
Diffstat (limited to 'src/d_iwad.c')
-rw-r--r--src/d_iwad.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/d_iwad.c b/src/d_iwad.c
index 3794164c..6f45c98c 100644
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -39,7 +39,7 @@
#include "w_wad.h"
#include "z_zone.h"
-static iwad_t iwads[] =
+static const iwad_t iwads[] =
{
{ "doom2.wad", doom2, commercial, "Doom II" },
{ "plutonia.wad", pack_plut, commercial, "Final Doom: Plutonia Experiment" },
@@ -749,9 +749,9 @@ char *D_FindIWAD(int mask, GameMission_t *mission)
// Find all IWADs in the IWAD search path matching the given mask.
-iwad_t **D_FindAllIWADs(int mask)
+const iwad_t **D_FindAllIWADs(int mask)
{
- iwad_t **result;
+ const iwad_t **result;
int result_len;
char *filename;
int i;
@@ -833,7 +833,8 @@ char *D_SuggestGameName(GameMission_t mission, GameMode_t mode)
for (i = 0; i < arrlen(iwads); ++i)
{
- if (iwads[i].mission == mission && iwads[i].mode == mode)
+ if (iwads[i].mission == mission
+ && (mode == indetermined || iwads[i].mode == mode))
{
return iwads[i].description;
}