OSDN Git Service

[Fix] #3546 店で存在しないアイテム番号を選択した後にEsc で抜けるとクラッシュする不具合を修正した
authorHourier <66951241+Hourier@users.noreply.github.com>
Fri, 14 Jul 2023 11:55:15 +0000 (20:55 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Fri, 14 Jul 2023 11:55:15 +0000 (20:55 +0900)
src/store/store.cpp

index abe793f..0ff2db6 100644 (file)
@@ -169,10 +169,11 @@ std::optional<short> input_stock(std::string_view fmt, int min, int max, [[maybe
     const auto prompt = format("(Items %c-%c, ESC to exit) %s", lo, hi, fmt.data());
 #endif
 
-    auto command = ESCAPE;
+    char command;
     while (true) {
         const auto command_opt = input_command(prompt);
         if (!command_opt.has_value()) {
+            command = ESCAPE;
             break;
         }