diff --git a/src/CommonItemSet.cc b/src/CommonItemSet.cc index 85077906..5bf7aedc 100644 --- a/src/CommonItemSet.cc +++ b/src/CommonItemSet.cc @@ -703,7 +703,7 @@ CommonItemSet::Table::Table(const phosg::StringReader& r, bool is_big_endian, bo template void CommonItemSet::Table::parse_itempt_t(const phosg::StringReader& r, bool is_v3) { - const auto& offsets = r.pget>(r.pget>(r.size() - 0x10)); + const auto& offsets = r.pget>(r.pget>(r.size() - 0x10)); this->base_weapon_type_prob_table = r.pget>(offsets.base_weapon_type_prob_table_offset); this->subtype_base_table = r.pget>(offsets.subtype_base_table_offset); diff --git a/src/CommonItemSet.hh b/src/CommonItemSet.hh index e226f676..bfaa2c02 100644 --- a/src/CommonItemSet.hh +++ b/src/CommonItemSet.hh @@ -69,7 +69,7 @@ public: void parse_itempt_t(const phosg::StringReader& r, bool is_v3); template - struct OffsetsT { + struct RootT { // This data structure uses index probability tables in multiple places. An index probability table is a table // where each entry holds the probability that that entry's index is used. For example, if the armor slot count // probability table contains [77, 17, 5, 1, 0], this means there is a 77% chance of no slots, 17% chance of 1 @@ -244,9 +244,9 @@ public: /* 50 */ U32T box_item_class_prob_table_offset; // There are several unused fields here. - } __packed_ws_be__(OffsetsT, 0x54); - using Offsets = OffsetsT; - using OffsetsBE = OffsetsT; + } __packed_ws_be__(RootT, 0x54); + using Root = RootT; + using RootBE = RootT; }; bool operator==(const CommonItemSet& other) const = default; diff --git a/src/LevelTable.hh b/src/LevelTable.hh index cbdd8d2a..503e1587 100644 --- a/src/LevelTable.hh +++ b/src/LevelTable.hh @@ -154,7 +154,7 @@ using LevelStatsDeltaBE = LevelStatsDeltaT; class LevelTable { // This is the base class for all the LevelTable implementations. The public interface here only defines functions // that the server needs to handle requests, but some subclasses implement more functionality. See the comments and - // Offsets structures inside the subclasses' constructor implementations for more details on the file formats. + // Root structures inside the subclasses' constructor implementations for more details on the file formats. public: virtual ~LevelTable() = default; diff --git a/src/RareItemSet.cc b/src/RareItemSet.cc index 41ac1ecf..10c99181 100644 --- a/src/RareItemSet.cc +++ b/src/RareItemSet.cc @@ -89,7 +89,7 @@ RareItemSet::ExpandedDrop RareItemSet::ParsedRELData::PackedDrop::expand() const template void RareItemSet::ParsedRELData::parse_t(phosg::StringReader r, bool is_v1) { const auto& footer = r.pget>(r.size() - sizeof(RELFileFooterT)); - const auto& root = r.pget>(footer.root_offset); + const auto& root = r.pget>(footer.root_offset); phosg::StringReader monsters_r = r.sub(root.monster_rares_offset); for (size_t z = 0; z < (is_v1 ? 0x33 : 0x65); z++) { @@ -114,7 +114,7 @@ template std::string RareItemSet::ParsedRELData::serialize_t(bool is_v1) const { static const PackedDrop empty_drop; - OffsetsT root; + RootT root; root.box_count = this->box_rares.size(); phosg::StringWriter w; diff --git a/src/RareItemSet.hh b/src/RareItemSet.hh index a16d716b..418b7736 100644 --- a/src/RareItemSet.hh +++ b/src/RareItemSet.hh @@ -87,15 +87,15 @@ protected: } __packed_ws__(PackedDrop, 4); template - struct OffsetsT { + struct RootT { /* 00 */ U32T monster_rares_offset; // -> parray (or 0x33 on v1) /* 04 */ U32T box_count; // Usually 30 (0x1E) /* 08 */ U32T box_areas_offset; // -> parray /* 0C */ U32T box_rares_offset; // -> parray /* 10 */ - } __packed_ws_be__(OffsetsT, 0x10); - using Offsets = OffsetsT; - using OffsetsBE = OffsetsT; + } __packed_ws_be__(RootT, 0x10); + using Root = RootT; + using RootBE = RootT; struct BoxRare { uint8_t area_norm_plus_1; diff --git a/system/tables/common-table-v3-v4.json b/system/tables/common-table-v3-v4.json index a41239e5..2d705673 100644 --- a/system/tables/common-table-v3-v4.json +++ b/system/tables/common-table-v3-v4.json @@ -1,6 +1,6 @@ { // This file specifies how non-rare items should be generated. For details on how each field works, see the comments - // in CommonItemSet::Table::OffsetsT (in CommonItemSet.hh). + // in CommonItemSet::Table::RootT (in CommonItemSet.hh). // Each scenario has defaults which are automatically propagated from the previous scenario unless overridden. The // order of precedence is: // - If the section ID is not Viridia, the defaults are from the same episode, game mode, and difficulty, but