mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 02:57:45 +00:00
refactor: fix coding style inconsistencies in loading
This commit is contained in:
parent
4cf82723bc
commit
b2bd202ed7
2 changed files with 12 additions and 12 deletions
|
@ -301,7 +301,7 @@ void Sapphire::Entity::Player::addCurrency( CurrencyType type, uint32_t amount )
|
||||||
|
|
||||||
uint32_t currentAmount = currItem->getStackSize();
|
uint32_t currentAmount = currItem->getStackSize();
|
||||||
currItem->setStackSize( currentAmount + amount );
|
currItem->setStackSize( currentAmount + amount );
|
||||||
writeMoney( type );
|
writeCurrencyItem( type );
|
||||||
|
|
||||||
updateContainer( Currency, slot, currItem );
|
updateContainer( Currency, slot, currItem );
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ void Sapphire::Entity::Player::removeCurrency( Common::CurrencyType type, uint32
|
||||||
currItem->setStackSize( 0 );
|
currItem->setStackSize( 0 );
|
||||||
else
|
else
|
||||||
currItem->setStackSize( currentAmount - amount );
|
currItem->setStackSize( currentAmount - amount );
|
||||||
writeItem( currItem );
|
writeCurrencyItem(type);
|
||||||
|
|
||||||
auto seq = getNextInventorySequence();
|
auto seq = getNextInventorySequence();
|
||||||
|
|
||||||
|
|
|
@ -696,7 +696,7 @@ bool Sapphire::Entity::Player::loadInventory()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto moneyRes = db.query("SELECT storageId, "
|
auto currencyRes = db.query("SELECT storageId, "
|
||||||
"container_0, container_1, container_2, container_3, container_4, "
|
"container_0, container_1, container_2, container_3, container_4, "
|
||||||
"container_5, container_6, container_7, container_8, container_9, "
|
"container_5, container_6, container_7, container_8, container_9, "
|
||||||
"container_10, container_11 "
|
"container_10, container_11 "
|
||||||
|
@ -704,10 +704,10 @@ bool Sapphire::Entity::Player::loadInventory()
|
||||||
"WHERE CharacterId = " + std::to_string(m_characterId) + " " \
|
"WHERE CharacterId = " + std::to_string(m_characterId) + " " \
|
||||||
"ORDER BY storageId ASC;");
|
"ORDER BY storageId ASC;");
|
||||||
|
|
||||||
while ( moneyRes->next() )
|
while ( currencyRes->next() )
|
||||||
{
|
{
|
||||||
uint16_t storageId = moneyRes->getUInt16( 1 );
|
uint16_t storageId = currencyRes->getUInt16( 1 );
|
||||||
uint32_t money = moneyRes->getUInt64(2);
|
uint32_t money = currencyRes->getUInt64( 2 );
|
||||||
|
|
||||||
auto slot = static_cast< uint8_t >( static_cast<uint8_t>( CurrencyType::Gil ) - 1 );
|
auto slot = static_cast< uint8_t >( static_cast<uint8_t>( CurrencyType::Gil ) - 1 );
|
||||||
auto currItem = m_storageMap[ Currency ]->getItem( slot );
|
auto currItem = m_storageMap[ Currency ]->getItem( slot );
|
||||||
|
|
Loading…
Add table
Reference in a new issue