summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2013-09-02 06:14:25 +0000
committerSimon Howard2013-09-02 06:14:25 +0000
commit544320206de9f54893aa77d2e4e75976e6fa84cb (patch)
tree94c93b6216c5778c1657d7db81358a9423cd4790
parentd7a54ff91636b507c115ba6bf48f57931b4d8407 (diff)
downloadchocolate-doom-544320206de9f54893aa77d2e4e75976e6fa84cb.tar.gz
chocolate-doom-544320206de9f54893aa77d2e4e75976e6fa84cb.tar.bz2
chocolate-doom-544320206de9f54893aa77d2e4e75976e6fa84cb.zip
Fix net_gamesettings_t checking code to use common function for checking
for episode/map number validation. Subversion-branch: /branches/v2-branch Subversion-revision: 2631
-rw-r--r--src/net_common.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/net_common.c b/src/net_common.c
index faadc27a..e254e9f0 100644
--- a/src/net_common.c
+++ b/src/net_common.c
@@ -533,33 +533,9 @@ boolean NET_ValidGameSettings(GameMode_t mode, GameMission_t mission,
if (!D_ValidGameVersion(mission, settings->gameversion))
return false;
- if (mode == shareware || mode == retail || mode == registered)
- {
- if (settings->map < 1 || settings->map > 9)
- return false;
- }
- else
- {
- if (settings->map < 1 || settings->map > 32)
- return false;
- }
-
- if (mode == shareware)
- {
- if (settings->episode != 1)
- return false;
- }
- else if (mode == registered)
- {
- if (settings->episode < 1 || settings->episode > 3)
- return false;
- }
- else if (mode == retail)
- {
- if (settings->episode < 1 || settings->episode > 4)
- return false;
- }
-
+ if (!D_ValidEpisodeMap(mission, mode, settings->episode, settings->map))
+ return false;
+
return true;
}