/** * Go to any level */ static void do_cmd_wiz_jump(void) { char ppp[80]; char tmp_val[160]; int new_place; /* Ask for level */ if (p_ptr->command_arg <= 0) { /* Prompt */ sprintf(ppp, "Jump to level (0-%d): ", MAX_DEPTH - 1); /* Default */ sprintf(tmp_val, "%d", p_ptr->depth); /* Ask for a level */ if (!get_string(ppp, tmp_val, 11)) return; /* Extract request */ p_ptr->command_arg = atoi(tmp_val); } /* Paranoia */ if (p_ptr->command_arg < 0) p_ptr->command_arg = 0; /* Paranoia */ if (p_ptr->command_arg > MAX_DEPTH - 1) p_ptr->command_arg = MAX_DEPTH - 1; /* Get choice */ if (!jump_menu(p_ptr->command_arg, &new_place)) { return; } /* New stage */ p_ptr->stage = new_place; /* New depth */ p_ptr->depth = stage_map[new_place][DEPTH]; /* Land properly */ p_ptr->last_stage = NOWHERE; /* Leaving */ p_ptr->leaving = TRUE; }
/** * Go to any level */ static void do_cmd_wiz_jump(void) { char ppp[80]; char tmp_val[160]; int new_place; /* Ask for level */ if (p_ptr->command_arg <= 0) { /* Prompt */ sprintf(ppp, "Jump to level (0-%d): ", MAX_DEPTH - 1); /* Default */ sprintf(tmp_val, "%d", p_ptr->danger); /* Ask for a level */ if (!get_string(ppp, tmp_val, 11)) return; /* Extract request */ p_ptr->command_arg = atoi(tmp_val); } /* Paranoia */ if (p_ptr->command_arg < 0) p_ptr->command_arg = 0; /* Paranoia */ if (p_ptr->command_arg > MAX_DEPTH - 1) p_ptr->command_arg = MAX_DEPTH - 1; /* Get choice */ if (!jump_menu(p_ptr->command_arg, &new_place)) { return; } //BELE work to do here }