OSDN Git Service

[Refactor] check_quest_placeable 内の変数 hoge を適切な名前に変えた
authorSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Wed, 30 Mar 2022 13:33:42 +0000 (22:33 +0900)
committerSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Wed, 6 Apr 2022 15:32:45 +0000 (00:32 +0900)
一般的なクエストの番号のため、Number にした

src/monster-floor/one-monster-placer.cpp

index 86f44f1..62544e1 100644 (file)
@@ -160,25 +160,25 @@ static bool check_quest_placeable(PlayerType *player_ptr, MonsterRaceId r_idx)
     }
 
     const auto &quest_list = QuestList::get_instance();
-    QuestId hoge = quest_number(player_ptr, floor_ptr->dun_level);
-    if ((quest_list[hoge].type != QuestKindType::KILL_LEVEL) && (quest_list[hoge].type != QuestKindType::RANDOM)) {
+    QuestId number = quest_number(player_ptr, floor_ptr->dun_level);
+    if ((quest_list[number].type != QuestKindType::KILL_LEVEL) && (quest_list[number].type != QuestKindType::RANDOM)) {
         return true;
     }
-    if (r_idx != quest_list[hoge].r_idx) {
+    if (r_idx != quest_list[number].r_idx) {
         return true;
     }
     int number_mon = 0;
     for (int i2 = 0; i2 < floor_ptr->width; ++i2) {
         for (int j2 = 0; j2 < floor_ptr->height; j2++) {
             auto quest_monster = (floor_ptr->grid_array[j2][i2].m_idx > 0);
-            quest_monster &= (floor_ptr->m_list[floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest_list[hoge].r_idx);
+            quest_monster &= (floor_ptr->m_list[floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest_list[number].r_idx);
             if (quest_monster) {
                 number_mon++;
             }
         }
     }
 
-    if (number_mon + quest_list[hoge].cur_num >= quest_list[hoge].max_num) {
+    if (number_mon + quest_list[number].cur_num >= quest_list[number].max_num) {
         return false;
     }
     return true;