diff --git a/src/world/Actor/PlayerInventory.cpp b/src/world/Actor/PlayerInventory.cpp index 96b347d2..8be59df6 100644 --- a/src/world/Actor/PlayerInventory.cpp +++ b/src/world/Actor/PlayerInventory.cpp @@ -301,7 +301,7 @@ void Sapphire::Entity::Player::addCurrency( CurrencyType type, uint32_t amount ) uint32_t currentAmount = currItem->getStackSize(); currItem->setStackSize( currentAmount + amount ); - writeMoney( CurrencyType::Gil ); + writeMoney( type ); updateContainer( Currency, slot, currItem ); @@ -563,7 +563,7 @@ void Sapphire::Entity::Player::writeMoney(CurrencyType type) std::string query = "UPDATE charaitemcurrency SET "; auto money = m_storageMap[Currency]->getItem(static_cast(type) - 1)->getStackSize(); - query += "container_0 = " + std::to_string(money); + query += "container_" + std::to_string(static_cast(type) - 1) + " = " + std::to_string(money); query += " WHERE CharacterId = " + std::to_string(getCharacterId()) + ";"; db.execute(query); diff --git a/src/world/Actor/PlayerSql.cpp b/src/world/Actor/PlayerSql.cpp index 83ba2590..6e097a5d 100644 --- a/src/world/Actor/PlayerSql.cpp +++ b/src/world/Actor/PlayerSql.cpp @@ -680,7 +680,6 @@ bool Sapphire::Entity::Player::loadInventory() while( bagRes->next() ) { - Logger::info("Loaded items"); uint16_t storageId = bagRes->getUInt16( 1 ); 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, " "container_0, container_1, container_2, container_3, container_4, " "container_5, container_6, container_7, container_8, container_9, "