OSDN Git Service

[Fix] ランダムアーティファクトが床に落ちるとクラッシュする
authorHabu <habu1010+github@gmail.com>
Mon, 20 Feb 2023 04:44:29 +0000 (13:44 +0900)
committerHabu <habu1010+github@gmail.com>
Mon, 20 Feb 2023 09:09:09 +0000 (18:09 +0900)
c0d486f で固定アーティファクトへのフロアIDの記録をdrop_near関数に移した
際、固定アーティファクトかどうかの判定をis_artifact()としてしまったため、
ランダムアーティファクトに対して固定アーティファクトのテーブルの検索を
行ってしまいクラッシュする。
正しくis_fixed_artifact()に修正する。

src/floor/floor-object.cpp

index 65eda97..feb2eff 100644 (file)
@@ -552,7 +552,7 @@ OBJECT_IDX drop_near(PlayerType *player_ptr, ItemEntity *j_ptr, PERCENTAGE chanc
         done = true;
     }
 
-    if (j_ptr->is_artifact() && w_ptr->character_dungeon) {
+    if (j_ptr->is_fixed_artifact() && w_ptr->character_dungeon) {
         auto &artifact = artifacts_info.at(j_ptr->fixed_artifact_idx);
         artifact.floor_id = player_ptr->floor_id;
     }