OSDN Git Service

[Refactor] #3756 BaseitemKey::refuse_enchant_weapon() を定義した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 2 Dec 2023 04:14:09 +0000 (13:14 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sat, 2 Dec 2023 04:14:09 +0000 (13:14 +0900)
src/system/baseitem-info.cpp
src/system/baseitem-info.h
src/system/item-entity.cpp

index a0d76e5..96a8495 100644 (file)
@@ -507,6 +507,11 @@ bool BaseitemKey::is_cross_bow() const
     }
 }
 
+bool BaseitemKey::refuse_enchant_weapon() const
+{
+    return *this == BaseitemKey(ItemKindType::SWORD, SV_POISON_NEEDLE);
+}
+
 bool BaseitemKey::is_mushrooms() const
 {
     if (!this->subtype_value) {
index 27c4b8d..e139239 100644 (file)
@@ -70,6 +70,7 @@ public:
     bool is_junk() const;
     bool is_armour() const;
     bool is_cross_bow() const;
+    bool refuse_enchant_weapon() const;
 
 private:
     ItemKindType type_value;
index 758dcba..555013c 100644 (file)
@@ -214,7 +214,7 @@ bool ItemEntity::is_wieldable_in_etheir_hand() const
  */
 bool ItemEntity::refuse_enchant_weapon() const
 {
-    return this->bi_key == BaseitemKey(ItemKindType::SWORD, SV_POISON_NEEDLE);
+    return this->bi_key.refuse_enchant_weapon();
 }
 
 /*!