1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-02 16:57:47 +00:00

remove model params from item constructor

This commit is contained in:
NotAdam 2018-12-25 21:53:05 +11:00
parent c6232f2395
commit 19017f6e12
7 changed files with 9 additions and 17 deletions

View file

@ -249,8 +249,8 @@ namespace Sapphire::Common
// housing exterior containers // housing exterior containers
HousingExteriorPlacedItems = 25001,
HousingExteriorAppearance = 25000, HousingExteriorAppearance = 25000,
HousingExteriorPlacedItems = 25001,
HousingExteriorStoreroom = 27000, HousingExteriorStoreroom = 27000,

View file

@ -580,10 +580,7 @@ Sapphire::ItemPtr Sapphire::Entity::Player::createItem( uint32_t catalogId, uint
uint8_t flags = 0; uint8_t flags = 0;
ItemPtr pItem = make_Item( Items::Util::getNextUId(), ItemPtr pItem = make_Item( Items::Util::getNextUId(), catalogId );
catalogId,
itemInfo->modelMain,
itemInfo->modelSub );
pItem->setStackSize( quantity ); pItem->setStackSize( quantity );

View file

@ -1,7 +1,7 @@
#include "HousingItem.h" #include "HousingItem.h"
Sapphire::Inventory::HousingItem::HousingItem( uint64_t uId, uint32_t catalogId ) : Sapphire::Inventory::HousingItem::HousingItem( uint64_t uId, uint32_t catalogId ) :
Sapphire::Item( uId, catalogId, 0, 0, false ) Sapphire::Item( uId, catalogId, false )
{ } { }
float Sapphire::Inventory::HousingItem::getRot() const float Sapphire::Inventory::HousingItem::getRot() const

View file

@ -7,11 +7,9 @@
extern Sapphire::Framework g_fw; extern Sapphire::Framework g_fw;
Sapphire::Item::Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_t model2, bool isHq ) : Sapphire::Item::Item( uint64_t uId, uint32_t catalogId, bool isHq ) :
m_id( catalogId ), m_id( catalogId ),
m_uId( uId ), m_uId( uId ),
m_model1( model1 ),
m_model2( model2 ),
m_isHq( isHq ), m_isHq( isHq ),
m_stain( 0 ), m_stain( 0 ),
m_durability( 30000 ) m_durability( 30000 )
@ -22,6 +20,8 @@ Sapphire::Item::Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_
m_delayMs = itemInfo->delayms; m_delayMs = itemInfo->delayms;
m_physicalDmg = itemInfo->damagePhys; m_physicalDmg = itemInfo->damagePhys;
m_magicalDmg = itemInfo->damageMag; m_magicalDmg = itemInfo->damageMag;
m_model1 = itemInfo->modelMain;
m_model2 = itemInfo->modelSub;
m_weaponDmg = ( m_physicalDmg != 0 ) ? m_physicalDmg : m_magicalDmg; m_weaponDmg = ( m_physicalDmg != 0 ) ? m_physicalDmg : m_magicalDmg;
m_autoAttackDmg = static_cast< float >( m_weaponDmg * m_delayMs ) / 3000; m_autoAttackDmg = static_cast< float >( m_weaponDmg * m_delayMs ) / 3000;
m_category = static_cast< Common::ItemUICategory >( itemInfo->itemUICategory ); m_category = static_cast< Common::ItemUICategory >( itemInfo->itemUICategory );

View file

@ -10,7 +10,7 @@ namespace Sapphire
{ {
public: public:
Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_t model2, bool isHq = false ); Item( uint64_t uId, uint32_t catalogId, bool isHq = false );
~Item() = default; ~Item() = default;

View file

@ -132,11 +132,7 @@ Sapphire::ItemPtr Sapphire::Items::Util::loadItem( uint64_t uId )
auto itemInfo = pExdData->get< Sapphire::Data::Item >( itemRes->getUInt( 1 ) ); auto itemInfo = pExdData->get< Sapphire::Data::Item >( itemRes->getUInt( 1 ) );
bool isHq = itemRes->getUInt( 3 ) == 1; bool isHq = itemRes->getUInt( 3 ) == 1;
ItemPtr pItem = make_Item( uId, ItemPtr pItem = make_Item( uId, itemRes->getUInt( 1 ), isHq );
itemRes->getUInt( 1 ),
itemInfo->modelMain,
itemInfo->modelSub,
isHq );
pItem->setStackSize( itemRes->getUInt( 2 ) ); pItem->setStackSize( itemRes->getUInt( 2 ) );

View file

@ -75,8 +75,7 @@ Sapphire::ItemPtr Sapphire::World::Manager::InventoryMgr::createItem( Entity::Pl
if( !itemInfo ) if( !itemInfo )
return nullptr; return nullptr;
auto item = make_Item( Items::Util::getNextUId(), catalogId, auto item = make_Item( Items::Util::getNextUId(), catalogId );
itemInfo->modelMain, itemInfo->modelSub );
item->setStackSize( std::max< uint32_t >( 1, quantity ) ); item->setStackSize( std::max< uint32_t >( 1, quantity ) );