OSDN Git Service

[Refactor] #37353 グローバル変数 dungeon_type を他の慣例に従い dungeon_idx に改名。 / Rename dungeon_typ...
[hengband/hengband.git] / src / init1.c
index c2e6d23..d4ba605 100644 (file)
@@ -50,6 +50,7 @@
 #include "trap.h"
 #include "monster.h"
 #include "artifact.h"
+#include "cmd-activate.h"
 
 
 
@@ -3842,17 +3843,11 @@ static errr parse_line_building(char *buf)
                {
                        int n;
                        n = tokenize(s + 2, MAX_CLASS, zz, 0);
-                       if (n <= MAX_CLASS)
-                       {
-                               for (i = 0; i < MAX_CLASS; i++)
-                               {       
-                                       building[index].member_class[i] = ((i > n) ? (CLASS_IDX)atoi(zz[i]) : 1);
-                               }
-
-                               break;
+                       for (i = 0; i < MAX_CLASS; i++)
+                       {       
+                               building[index].member_class[i] = ((i < n) ? (CLASS_IDX)atoi(zz[i]) : 1);
                        }
-
-                       return (PARSE_ERROR_TOO_FEW_ARGUMENTS);
+                       break;
                }
 
                /* Building Races */
@@ -3860,17 +3855,11 @@ static errr parse_line_building(char *buf)
                {
                        int n;
                        n = tokenize(s + 2, MAX_RACES, zz, 0);
-                       if (n <= MAX_RACES)
+                       for (i = 0; i < MAX_RACES; i++)
                        {
-                               for (i = 0; i < MAX_RACES; i++)
-                               {
-                                       building[index].member_race[i] = ((i > n) ? (RACE_IDX)atoi(zz[i]) : 1);
-                               }
-
-                               break;
+                               building[index].member_race[i] = ((i < n) ? (RACE_IDX)atoi(zz[i]) : 1);
                        }
-
-                       return (PARSE_ERROR_TOO_FEW_ARGUMENTS);
+                       break;
                }
 
                /* Building Realms */
@@ -3878,17 +3867,11 @@ static errr parse_line_building(char *buf)
                {
                        int n;
                        n = tokenize(s + 2, MAX_MAGIC, zz, 0);
-                       if (n <= MAX_MAGIC)
+                       for (i = 0; i < MAX_MAGIC; i++)
                        {
-                               for (i = 0; i < MAX_MAGIC; i++)
-                               {
-                                       building[index].member_realm[i+1] = ((i > n) ? (REALM_IDX)atoi(zz[i]) : 1);
-                               }
-
-                               break;
+                               building[index].member_realm[i+1] = ((i < n) ? (REALM_IDX)atoi(zz[i]) : 1);
                        }
-
-                       return (PARSE_ERROR_TOO_FEW_ARGUMENTS);
+                       break;
                }
 
                case 'Z':