From 60c1aa71dc1c6a852b0b66282e7d853281fe5523 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sun, 10 Dec 2023 17:30:58 -0800 Subject: [PATCH] fix ToolV4 structure --- src/ItemParameterTable.cc | 2 +- src/ItemParameterTable.hh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ItemParameterTable.cc b/src/ItemParameterTable.cc index 2b708132..5dc747fc 100644 --- a/src/ItemParameterTable.cc +++ b/src/ItemParameterTable.cc @@ -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"); diff --git a/src/ItemParameterTable.hh b/src/ItemParameterTable.hh index a1dd1273..64ac7644 100644 --- a/src/ItemParameterTable.hh +++ b/src/ItemParameterTable.hh @@ -207,12 +207,12 @@ public: struct Tool { using U16T = typename std::conditional::type; using S32T = typename std::conditional::type; + using U32T = typename std::conditional::type; BaseT base; U16T amount = 0; U16T tech = 0; S32T cost = 0; - uint8_t item_flag = 0; - parray unused; + U32T item_flag = 0; } __attribute__((packed)); struct ToolV2 : Tool, false> { } __attribute__((packed));