OSDN Git Service

[Fix] #3035 モンスターへ冠詞を付ける処理が正しく行われていなかったので修正した
authorHourier <66951241+Hourier@users.noreply.github.com>
Fri, 30 Dec 2022 11:41:56 +0000 (20:41 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Tue, 17 Jan 2023 08:00:55 +0000 (17:00 +0900)
src/monster/monster-describer.cpp

index de92ef4..c4b0491 100644 (file)
@@ -196,10 +196,16 @@ static std::string describe_non_pet(const PlayerType &player, const MonsterEntit
     }
 
     if (any_bits(mode, MD_INDEF_VISIBLE)) {
-#ifndef JP
-        return is_a_vowel(name[0]) ? "an " : "a ";
-#endif
+#ifdef JP
         return name;
+#else
+        std::stringstream ss;
+        const auto first_char = name[0];
+        const auto article = is_a_vowel(first_char) ? "an " : "a ";
+        ss << article;
+        ss << name;
+        return ss.str();
+#endif
     }
 
     std::stringstream ss;