From 544320206de9f54893aa77d2e4e75976e6fa84cb Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 2 Sep 2013 06:14:25 +0000 Subject: 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 --- src/net_common.c | 30 +++--------------------------- 1 file 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; } -- cgit v1.2.3