fix ToolV4 structure

This commit is contained in:
Martin Michelsen
2023-12-10 17:30:58 -08:00
parent a315f6d011
commit 60c1aa71dc
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -381,7 +381,7 @@ const ItemParameterTable::ToolV4& ItemParameterTable::get_tool(uint8_t data1_1,
def_v4.amount = def_v3.amount.load();
def_v4.tech = def_v3.tech.load();
def_v4.cost = def_v3.cost.load();
def_v4.item_flag = def_v3.item_flag;
def_v4.item_flag = def_v3.item_flag.load();
} else {
throw logic_error("table is not v2, v3, or v4");
+2 -2
View File
@@ -207,12 +207,12 @@ public:
struct Tool {
using U16T = typename std::conditional<IsBigEndian, be_uint16_t, le_uint16_t>::type;
using S32T = typename std::conditional<IsBigEndian, be_int32_t, le_int32_t>::type;
using U32T = typename std::conditional<IsBigEndian, be_uint32_t, le_uint32_t>::type;
BaseT base;
U16T amount = 0;
U16T tech = 0;
S32T cost = 0;
uint8_t item_flag = 0;
parray<uint8_t, 3> unused;
U32T item_flag = 0;
} __attribute__((packed));
struct ToolV2 : Tool<ItemBaseV2<false>, false> {
} __attribute__((packed));