Increased possible storage limit (#5972)

Disallowing the compiler to add padding to the structures allows more items in storage again.
This commit is contained in:
Lemongrass3110 2021-05-29 23:10:55 +02:00 committed by GitHub
parent f2b0c9426d
commit 5d92d1a000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,12 +249,6 @@ struct quest {
e_quest_state state; ///< Current quest state e_quest_state state; ///< Current quest state
}; };
struct s_item_randomoption {
short id;
short value;
char param;
};
/// Achievement log entry /// Achievement log entry
struct achievement { struct achievement {
int achievement_id; ///< Achievement ID int achievement_id; ///< Achievement ID
@ -264,6 +258,17 @@ struct achievement {
int score; ///< Amount of points achievement is worth 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 { struct item {
int id; int id;
t_itemid nameid; t_itemid nameid;
@ -279,7 +284,12 @@ struct item {
uint64 unique_id; uint64 unique_id;
unsigned int equipSwitch; // location(s) where item is equipped for equip switching (using enum equip_pos for bitmasking) unsigned int equipSwitch; // location(s) where item is equipped for equip switching (using enum equip_pos for bitmasking)
uint8 enchantgrade; 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 //Equip position constants
enum equip_pos : uint32 { enum equip_pos : uint32 {