From 5d92d1a0000a81297c973a4712ae2f146048965a Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Sat, 29 May 2021 23:10:55 +0200 Subject: [PATCH] Increased possible storage limit (#5972) Disallowing the compiler to add padding to the structures allows more items in storage again. --- src/common/mmo.hpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/common/mmo.hpp b/src/common/mmo.hpp index d0912ca6b8..64e739817a 100644 --- a/src/common/mmo.hpp +++ b/src/common/mmo.hpp @@ -249,12 +249,6 @@ struct quest { e_quest_state state; ///< Current quest state }; -struct s_item_randomoption { - short id; - short value; - char param; -}; - /// Achievement log entry struct achievement { int achievement_id; ///< Achievement ID @@ -264,6 +258,17 @@ struct achievement { int score; ///< Amount of points achievement is worth }; +// NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute +#if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 ) + #pragma pack( push, 1 ) +#endif + +struct s_item_randomoption { + short id; + short value; + char param; +} __attribute__((packed)); + struct item { int id; t_itemid nameid; @@ -279,7 +284,12 @@ struct item { uint64 unique_id; unsigned int equipSwitch; // location(s) where item is equipped for equip switching (using enum equip_pos for bitmasking) uint8 enchantgrade; -}; +} __attribute__((packed)); + +// NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute +#if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 ) + #pragma pack( pop ) +#endif //Equip position constants enum equip_pos : uint32 {