]> granicus.if.org Git - nethack/commitdiff
symset restrictions (trunk only)
authornethack.allison <nethack.allison>
Tue, 17 Oct 2006 11:56:31 +0000 (11:56 +0000)
committernethack.allison <nethack.allison>
Tue, 17 Oct 2006 11:56:31 +0000 (11:56 +0000)
The restricted bits could end up set on non-restricted sets.
This case needs to check that we're in a matching set.

src/files.c

index 092f14381715a25c95215eedbadada3bab76fb1a..6dedcfed75be0947acc7b5413ec23aa63cfb87a2 100644 (file)
@@ -2625,9 +2625,10 @@ int which_set;
                            }
                            break;
                   case 5:  /* restrictions: xxxx*/
-                           i = 0;
-                           while (known_restrictions[i]) {
-                               if (!strcmpi(known_restrictions[i], bufp)) {
+                           if (chosen_symset_start) {
+                               i = 0;
+                               while (known_restrictions[i]) {
+                                   if (!strcmpi(known_restrictions[i], bufp)) {
                                    switch(i) {
                                        case  0: symset[which_set].primary = 1;
                                                 break;
@@ -2635,9 +2636,10 @@ int which_set;
                                                 break;
                                    }
                                    break;      /* while loop */
-                               }
-                               i++;
-                           }
+                                   }
+                                   i++;
+                               }
+                           }
                            break;
                }
            } else {            /* !SYM_CONTROL */