From 0bd352b50b78ce6391f8bfa403dfc5f8b25047c2 Mon Sep 17 00:00:00 2001 From: NotAdam Date: Sat, 30 Jun 2018 11:53:45 +1000 Subject: [PATCH] create larger stacks correctly, fix indent --- src/servers/sapphire_zone/Inventory/Inventory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/servers/sapphire_zone/Inventory/Inventory.cpp b/src/servers/sapphire_zone/Inventory/Inventory.cpp index e1d2078b..84fa68cc 100644 --- a/src/servers/sapphire_zone/Inventory/Inventory.cpp +++ b/src/servers/sapphire_zone/Inventory/Inventory.cpp @@ -134,7 +134,7 @@ Core::ItemPtr Core::Inventory::createItem( uint32_t catalogId, uint16_t quantity auto pDb = g_fw.get< Db::DbWorkerPool< Db::CharaDbConnection > >(); auto itemInfo = pExdData->get< Core::Data::Item >( catalogId ); - uint8_t itemAmount = quantity; + uint16_t itemAmount = quantity; if( itemInfo->stackSize == 1 ) itemAmount = 1; @@ -146,14 +146,14 @@ Core::ItemPtr Core::Inventory::createItem( uint32_t catalogId, uint16_t quantity // std::string itemName( itemInfo->name ); - ItemPtr pItem( new Item( catalogId ) ); + ItemPtr pItem = make_Item( catalogId ); pItem->setStackSize( itemAmount ); pItem->setUId( getNextUId() ); pItem->setModelIds( itemInfo->modelMain, itemInfo->modelSub ); pItem->setCategory( static_cast< ItemUICategory >( itemInfo->itemUICategory ) ); - pDb->execute( "INSERT INTO charaglobalitem ( CharacterId, itemId, catalogId, stack, flags ) VALUES ( " + + pDb->execute( "INSERT INTO charaglobalitem ( CharacterId, itemId, catalogId, stack, flags ) VALUES ( " + std::to_string( m_pOwner->getId() ) + ", " + std::to_string( pItem->getUId() ) + ", " + std::to_string( pItem->getId() ) + ", " +