diff src/yadex.cc @ 75:e6175d0a667b

Get rid of the mostly useless find_level() and associated logic.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Sep 2011 13:44:40 +0300
parents e5cd0f139fc1
children 042b44809e6e
line wrap: on
line diff
--- a/src/yadex.cc	Mon Sep 26 12:52:49 2011 +0300
+++ b/src/yadex.cc	Mon Sep 26 13:44:40 2011 +0300
@@ -700,26 +700,7 @@
                     level_name = 0;
             else
             {
-                level_name = find_level(com);
-                if (level_name == error_invalid)
-                {
-                    printf("\"%s\" is not a valid level name.\n", com);
-                    continue;
-                }
-                else if (level_name == error_none)
-                {
-                    printf("Neither E%dM%d nor MAP%02d exist.\n",
-                           atoi(com) / 10, atoi(com) % 10, atoi(com));
-                    continue;
-                }
-                else if (level_name == error_non_unique)
-                {
-                    printf
-                        ("Both E%dM%d and MAP%02d exist. Use an unambiguous name.\n",
-                         atoi(com) / 10, atoi(com) % 10, atoi(com));
-                    continue;
-                }
-                else if (level_name == NULL)
+                if (FindMasterDir(MasterDir, com))
                 {
                     printf("Level %s not found.", com);
                     // Hint absent-minded users
@@ -733,8 +714,6 @@
                 }
             }
             EditLevel(level_name, newlevel);
-            if (level_name)
-                free(level_name);
         }
 
         /* user asked to build a new main wad file */