this->choice = (always_show_list || use_menu) ? ESCAPE : 1;
while (!this->flag) {
- if (this->choice == ESCAPE)
+ if (this->choice == ESCAPE) {
this->choice = ' ';
- else if (!get_com(out_val, &this->choice, true))
+ } else if (!get_com(out_val, &this->choice, true)) {
break;
+ }
if (!interpret_mind_key_input(only_browse)) {
return false;
continue;
}
- if (!use_menu) {
- this->ask = (bool)isupper(this->choice);
- if (this->ask)
- this->choice = (char)tolower(this->choice);
-
- this->index = (islower(this->choice) ? A2I(this->choice) : -1);
- }
-
+ make_choice_lower();
if ((this->index < 0) || (this->index >= this->num)) {
bell();
continue;
prt("", y + this->index + 1, x);
return true;
}
-
+
if (only_browse) {
- return true;
+ return true;
}
this->redraw = false;
this->chance += 5;
}
}
+
+void MindPowerGetter::make_choice_lower()
+{
+ if (use_menu) {
+ return;
+ }
+
+ this->ask = (bool)isupper(this->choice);
+ if (this->ask) {
+ this->choice = (char)tolower(this->choice);
+ }
+
+ this->index = (islower(this->choice) ? A2I(this->choice) : -1);
+}