mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
Use generated ItemUICategory; Check if field for item is valid;
This commit is contained in:
parent
add49a250b
commit
7a2f83afb2
2 changed files with 21 additions and 20 deletions
|
@ -439,24 +439,24 @@ bool Core::Inventory::removeCrystal( CrystalType type, uint32_t amount )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Core::Inventory::isOneHandedWeapon( ItemCategory weaponCategory )
|
bool Core::Inventory::isOneHandedWeapon( ItemUICategory weaponCategory )
|
||||||
{
|
{
|
||||||
switch ( weaponCategory )
|
switch ( weaponCategory )
|
||||||
{
|
{
|
||||||
case ItemCategory::AlcPri:
|
case ItemUICategory::AlchemistsPrimaryTool:
|
||||||
case ItemCategory::ArmPri:
|
case ItemUICategory::ArmorersPrimaryTool:
|
||||||
case ItemCategory::BotPri:
|
case ItemUICategory::BotanistsPrimaryTool:
|
||||||
case ItemCategory::ClnPri:
|
case ItemUICategory::CulinariansPrimaryTool:
|
||||||
case ItemCategory::CnjWep:
|
case ItemUICategory::OnehandedConjurersArm:
|
||||||
case ItemCategory::CrpPri:
|
case ItemUICategory::CarpentersPrimaryTool:
|
||||||
case ItemCategory::FshPri:
|
case ItemUICategory::FishersPrimaryTool:
|
||||||
case ItemCategory::GlaWep:
|
case ItemUICategory::GladiatorsArm:
|
||||||
case ItemCategory::GldPri: // Goldsmith
|
case ItemUICategory::GoldsmithsPrimaryTool:
|
||||||
case ItemCategory::LtwPri:
|
case ItemUICategory::LeatherworkersPrimaryTool:
|
||||||
case ItemCategory::MinPri:
|
case ItemUICategory::MinersPrimaryTool:
|
||||||
case ItemCategory::ThmWep:
|
case ItemUICategory::OnehandedThaumaturgesArm:
|
||||||
case ItemCategory::WvrPri:
|
case ItemUICategory::WeaversPrimaryTool:
|
||||||
case ItemCategory::BlmPri: // Blacksmith
|
case ItemUICategory::BlacksmithsPrimaryTool:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -475,7 +475,8 @@ int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t
|
||||||
|
|
||||||
auto itemInfo = g_exdData.getItemInfo( catalogId );
|
auto itemInfo = g_exdData.getItemInfo( catalogId );
|
||||||
|
|
||||||
if( !itemInfo )
|
// if item data doesn't exist or it's a blank field
|
||||||
|
if( !itemInfo || itemInfo->item_level == 0 )
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ public:
|
||||||
bool updateContainer( uint16_t containerId, uint8_t slotId, ItemPtr pItem );
|
bool updateContainer( uint16_t containerId, uint8_t slotId, ItemPtr pItem );
|
||||||
|
|
||||||
/*! heck if weapon category qualifies the weapon as onehanded */
|
/*! heck if weapon category qualifies the weapon as onehanded */
|
||||||
bool isOneHandedWeapon( Common::ItemCategory weaponCategory );
|
bool isOneHandedWeapon( Common::ItemUICategory weaponCategory );
|
||||||
/*! calculate and return player ilvl based off equipped gear */
|
/*! calculate and return player ilvl based off equipped gear */
|
||||||
uint16_t calculateEquippedGearItemLevel();
|
uint16_t calculateEquippedGearItemLevel();
|
||||||
/*! return the current amount of currency of type */
|
/*! return the current amount of currency of type */
|
||||||
|
|
Loading…
Add table
Reference in a new issue