OSDN Git Service

[Refactor] 発生源に使用されているwhoをリネーム
[hengbandforosx/hengbandosx.git] / src / spell / spells-summon.cpp
index 33e1317..290dc3e 100644 (file)
@@ -55,7 +55,7 @@ bool trump_summoning(PlayerType *player_ptr, int num, bool pet, POSITION y, POSI
         lev = plev * 2 / 3 + randint1(plev / 2);
     }
 
-    MONSTER_IDX who;
+    MONSTER_IDX src_idx;
     if (pet) {
         /* Become pet */
         mode |= PM_FORCE_PET;
@@ -69,18 +69,18 @@ bool trump_summoning(PlayerType *player_ptr, int num, bool pet, POSITION y, POSI
         }
 
         /* Player is who summons */
-        who = -1;
+        src_idx = -1;
     } else {
         /* Prevent taming, allow unique monster */
         mode |= PM_NO_PET;
 
         /* Behave as if they appear by themselfs */
-        who = 0;
+        src_idx = 0;
     }
 
     bool success = false;
     for (int i = 0; i < num; i++) {
-        if (summon_specific(player_ptr, who, y, x, lev, type, mode)) {
+        if (summon_specific(player_ptr, src_idx, y, x, lev, type, mode)) {
             success = true;
         }
     }
@@ -260,18 +260,18 @@ bool summon_kin_player(PlayerType *player_ptr, DEPTH level, POSITION y, POSITION
 /*!
  * @brief サイバーデーモンの召喚
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 召喚主のモンスターID(0ならばプレイヤー)
+ * @param src_idx 召喚主のモンスターID(0ならばプレイヤー)
  * @param y 召喚位置Y座標
  * @param x 召喚位置X座標
  * @return 作用が実際にあった場合TRUEを返す
  */
-int summon_cyber(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x)
+int summon_cyber(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x)
 {
     /* Summoned by a monster */
     BIT_FLAGS mode = PM_ALLOW_GROUP;
     auto *floor_ptr = player_ptr->current_floor_ptr;
-    if (who > 0) {
-        auto *m_ptr = &floor_ptr->m_list[who];
+    if (src_idx > 0) {
+        auto *m_ptr = &floor_ptr->m_list[src_idx];
         if (m_ptr->is_pet()) {
             mode |= PM_FORCE_PET;
         }
@@ -284,7 +284,7 @@ int summon_cyber(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x
 
     int count = 0;
     for (int i = 0; i < max_cyber; i++) {
-        count += summon_specific(player_ptr, who, y, x, 100, SUMMON_CYBER, mode);
+        count += summon_specific(player_ptr, src_idx, y, x, 100, SUMMON_CYBER, mode);
     }
 
     return count;