OSDN Git Service

[Fix] #38852 Habu氏の報告で確認したcompare_weapons()のエンバグを修正。 / Fix compare_weapons() by Habu...
authorDeskull <deskull@users.sourceforge.jp>
Mon, 14 Jan 2019 02:13:54 +0000 (11:13 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Mon, 14 Jan 2019 02:13:54 +0000 (11:13 +0900)
src/bldg.c

index 0dd12fe..a23c678 100644 (file)
@@ -2681,7 +2681,7 @@ static PRICE compare_weapons(PRICE bcost)
        s = _("比べるものがありません。", "You have nothing to compare.");
 
        o_ptr[0] = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT));
-       if (!o_ptr)
+       if (!o_ptr[0])
        {
                screen_load();
                return (0);
@@ -2752,7 +2752,7 @@ static PRICE compare_weapons(PRICE bcost)
 
                        /* Get the second weapon */
                        o_ptr[1] = choose_object(&item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT));
-                       if (!o_ptr) continue;
+                       if (!o_ptr[1]) continue;
 
                        total += cost;
                        cost = bcost / 2;