OSDN Git Service

[Refactor] VS2022 で出ているコンパイル警告を解消した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 2 Dec 2023 06:06:28 +0000 (15:06 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sat, 2 Dec 2023 06:06:28 +0000 (15:06 +0900)
src/action/activation-execution.cpp
src/system/item-entity.cpp
src/system/item-entity.h

index 8375bb6..46f5aee 100644 (file)
@@ -214,7 +214,7 @@ static bool activate_whistle(PlayerType *player_ptr, ae_type *ae_ptr)
         }
     }
 
-    uint16_t dummy_why;
+    short dummy_why = 0;
     ang_sort(player_ptr, who.data(), &dummy_why, who.size(), ang_sort_comp_pet, ang_sort_swap_hook);
     for (auto pet_ctr : who) {
         teleport_monster_to(player_ptr, pet_ctr, player_ptr->y, player_ptr->x, 100, TELEPORT_PASSIVE);
index 5a5823d..07b506b 100644 (file)
@@ -1009,7 +1009,7 @@ void ItemEntity::mark_as_known()
 /*!
  * @brief オブジェクトを試行済にする
  */
-void ItemEntity::mark_as_tried()
+void ItemEntity::mark_as_tried() const
 {
     this->get_baseitem().mark_as_tried();
 }
index faae4b0..5944052 100644 (file)
@@ -150,7 +150,7 @@ public:
     std::string explain_activation() const;
 
     void mark_as_known();
-    void mark_as_tried();
+    void mark_as_tried() const;
 
 private:
     int get_baseitem_price() const;