1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-24 18:47:45 +00:00

removed hardcoding and fixed debug console spam

This commit is contained in:
Matthe815 2023-01-05 00:10:34 -05:00
parent bcb6c2b404
commit b9aee98a7c
No known key found for this signature in database
GPG key ID: 6B963FE816B1DC39
2 changed files with 2 additions and 5 deletions

View file

@ -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( CurrencyType::Gil ); writeMoney( type );
updateContainer( Currency, slot, currItem ); updateContainer( Currency, slot, currItem );
@ -563,7 +563,7 @@ void Sapphire::Entity::Player::writeMoney(CurrencyType type)
std::string query = "UPDATE charaitemcurrency SET "; std::string query = "UPDATE charaitemcurrency SET ";
auto money = m_storageMap[Currency]->getItem(static_cast<uint16_t>(type) - 1)->getStackSize(); auto money = m_storageMap[Currency]->getItem(static_cast<uint16_t>(type) - 1)->getStackSize();
query += "container_0 = " + std::to_string(money); query += "container_" + std::to_string(static_cast<int16_t>(type) - 1) + " = " + std::to_string(money);
query += " WHERE CharacterId = " + std::to_string(getCharacterId()) + ";"; query += " WHERE CharacterId = " + std::to_string(getCharacterId()) + ";";
db.execute(query); db.execute(query);

View file

@ -680,7 +680,6 @@ bool Sapphire::Entity::Player::loadInventory()
while( bagRes->next() ) while( bagRes->next() )
{ {
Logger::info("Loaded items");
uint16_t storageId = bagRes->getUInt16( 1 ); uint16_t storageId = bagRes->getUInt16( 1 );
for( uint32_t i = 1; i <= m_storageMap[ storageId ]->getMaxSize(); i++ ) for( uint32_t i = 1; i <= m_storageMap[ storageId ]->getMaxSize(); i++ )
{ {
@ -697,8 +696,6 @@ bool Sapphire::Entity::Player::loadInventory()
} }
} }
Logger::info(std::to_string(m_characterId));
auto moneyRes = db.query("SELECT storageId, " auto moneyRes = 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, "