OSDN Git Service

^A j でダンジョンだけ指定して階指定をキャンセルすると, 階はそのままでダンジョンだけが
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 9 May 2003 15:45:42 +0000 (15:45 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 9 May 2003 15:45:42 +0000 (15:45 +0000)
変わったことになるバグを修正.

src/wizard2.c

index 091caf1..e12a915 100644 (file)
@@ -1449,6 +1449,7 @@ static void do_cmd_wiz_jump(void)
                char    ppp[80];
 
                char    tmp_val[160];
+               int             tmp_dungeon_type;
 
                /* Prompt */
                sprintf(ppp, "Jump which dungeon : ");
@@ -1459,11 +1460,11 @@ static void do_cmd_wiz_jump(void)
                /* Ask for a level */
                if (!get_string(ppp, tmp_val, 2)) return;
 
-               dungeon_type = atoi(tmp_val);
-               if (!d_info[dungeon_type].maxdepth || (dungeon_type > max_d_idx)) dungeon_type = DUNGEON_ANGBAND;
+               tmp_dungeon_type = atoi(tmp_val);
+               if (!d_info[tmp_dungeon_type].maxdepth || (tmp_dungeon_type > max_d_idx)) tmp_dungeon_type = DUNGEON_ANGBAND;
 
                /* Prompt */
-               sprintf(ppp, "Jump to level (0, %d-%d): ", d_info[dungeon_type].mindepth, d_info[dungeon_type].maxdepth);
+               sprintf(ppp, "Jump to level (0, %d-%d): ", d_info[tmp_dungeon_type].mindepth, d_info[tmp_dungeon_type].maxdepth);
 
                /* Default */
                sprintf(tmp_val, "%d", dun_level);
@@ -1473,6 +1474,8 @@ static void do_cmd_wiz_jump(void)
 
                /* Extract request */
                command_arg = atoi(tmp_val);
+
+               dungeon_type = tmp_dungeon_type;
        }
 
        /* Paranoia */