01-26-2014, 08:58 PM
First of all don't declare the enchantments enum - it's already declared in cEnchantments, you just need to name it there (put the "eEnchantmentType" after the "enum" keyword), then you can use it anywhere as cEnchantments::eEnchantmentType.
Then, to simplify the later hooks, use:
Use the cEnchantments type to store the enchantments.
Also, in order to reduce needless copying, use the following function signature:
Then, to simplify the later hooks, use:
1 2 | // In Enchantments.h: typedef std::vector<cEnchantment> cEnchantments; |
Also, in order to reduce needless copying, use the following function signature:
1 2 | /** Fills a_Enchantments with the list of enchantments applicable to the specified item type */ static void cItem::GetApplicableEnchantmentsForType( short a_ItemType, cEnchantments & a_Enchantments); |