changeset 78:626678d4ecf3

Changes in e6175d0a667b were buggy, find_level logic replacement now fixed.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Sep 2011 17:05:58 +0300
parents 9b8da7c7219e
children 0602d9bf474a
files src/yadex.cc
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/yadex.cc	Mon Sep 26 13:46:17 2011 +0300
+++ b/src/yadex.cc	Mon Sep 26 17:05:58 2011 +0300
@@ -707,17 +707,25 @@
             }
             else
             {
-                if (FindMasterDir(MasterDir, com))
+                MDirPtr entry = FindMasterDir(MasterDir, com);
+                if (entry != NULL)
+                {
+                    level_name = strdup(entry->dir.name);
+                }
+                else
                 {
                     printf("Level '%s' not found.", com);
+
                     // Hint absent-minded users
                     if ((tolower(*com) == 'e' && yg_level_name == YGLN_MAP01) ||
                         (tolower(*com) == 'm' && yg_level_name == YGLN_E1M1))
                         printf(" You are in %s mode.", Game);
                     else
+
                     if (tolower(*com) == 'e' && com[1] > '1' && !Registered)
-                        printf(" You have the shareware iwad.");
-                    putchar('\n');
+                        printf(" You have the shareware IWAD.");
+
+                    printf("\n");
                     continue;
                 }
             }