OSDN Git Service

[Refactor] #2205 generate_figurine() のポインタを参照に変えた
authorHourier <66951241+Hourier@users.noreply.github.com>
Wed, 23 Feb 2022 02:54:41 +0000 (11:54 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Wed, 23 Feb 2022 04:19:31 +0000 (13:19 +0900)
src/object-enchant/others/apply-magic-others.cpp

index 9cae0d6..97c38c8 100644 (file)
@@ -149,9 +149,9 @@ void OtherItemsEnchanter::generate_corpse()
     short r_idx;
     while (true) {
         r_idx = get_mon_num(this->player_ptr, 0, floor_ptr->dun_level, 0);
-        auto *r_ptr = &r_info[r_idx];
-        auto check = (floor_ptr->dun_level < r_ptr->level) ? (r_ptr->level - floor_ptr->dun_level) : 0;
-        if ((r_ptr->rarity == 0) || none_bits(r_ptr->flags9, match) || (randint0(check) > 0)) {
+        auto &r_ref = r_info[r_idx];
+        auto check = (floor_ptr->dun_level < r_ref.level) ? (r_ref.level - floor_ptr->dun_level) : 0;
+        if ((r_ref.rarity == 0) || none_bits(r_ref.flags9, match) || (randint0(check) > 0)) {
             continue;
         }