OSDN Git Service

[Refactor] #3381 vault_type にコンストラクタを定義し、初期値を追加した。もって未初期化警告に対応した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 10 Jun 2023 07:09:57 +0000 (16:09 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sat, 10 Jun 2023 13:36:48 +0000 (22:36 +0900)
src/room/rooms-vault.h

index 7571712..17d2dd5 100644 (file)
@@ -1,19 +1,20 @@
 #pragma once
 
-#include "system/angband.h"
+#include <stdint.h>
 #include <string>
 #include <vector>
 
 struct vault_type {
-    int16_t idx;
+    vault_type() = default;
+    short idx = 0;
 
-    std::string name; /* Name (offset) */
-    std::string text; /* Text (offset) */
+    std::string name = ""; /* Name (offset) */
+    std::string text = ""; /* Text (offset) */
 
-    byte typ{}; /* Vault type */
-    PROB rat{}; /* Vault rating (unused) */
-    POSITION hgt{}; /* Vault height */
-    POSITION wid{}; /* Vault width */
+    uint8_t typ = 0; /* Vault type */
+    int rat = 0; /* Vault rating (unused) */
+    int hgt = 0; /* Vault height */
+    int wid = 0; /* Vault width */
 };
 
 extern std::vector<vault_type> vaults_info;