diff --git a/common/database.cpp b/common/database.cpp index 7f7af3f2c..ed90b9a79 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -708,7 +708,9 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe /* This only for new Character creation storing */ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inventory* inv) { - uint32 charid = 0; char zone[50]; float x, y, z; + uint32 charid = 0; + char zone[50]; + float x, y, z; charid = GetCharacterID(pp->name); if(!charid) { @@ -739,7 +741,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)", charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor()); - auto results = QueryDatabase(invquery); + auto results = QueryDatabase(invquery); if (!results.RowsAffected()) LogFile->write(EQEMuLog::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); @@ -749,9 +751,18 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven #endif } - if (i == MainCursor) { i = EmuConstants::GENERAL_BAGS_BEGIN; continue; } - else if (i == EmuConstants::CURSOR_BAG_END) { i = EmuConstants::BANK_BEGIN; continue; } - else if (i == EmuConstants::BANK_END) { i = EmuConstants::BANK_BAGS_BEGIN; continue; } + if (i == MainCursor) { + i = EmuConstants::GENERAL_BAGS_BEGIN; + continue; + } + else if (i == EmuConstants::CURSOR_BAG_END) { + i = EmuConstants::BANK_BEGIN; + continue; + } + else if (i == EmuConstants::BANK_END) { + i = EmuConstants::BANK_BAGS_BEGIN; + continue; + } i++; } return true; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 69c97b5f0..aecfa0488 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -347,8 +347,8 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) { bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) { const Item_Struct* myitem; uint32 itemid = 0; - uint32 charges = 0; - uint32 slot = 0; + int32 charges = 0; + int32 slot = 0; auto query = StringFormat( "SELECT `itemid`, `item_charges`, `slot` FROM `starting_items`" " WHERE (`race` = %i OR `race` = 0)" @@ -363,7 +363,7 @@ bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv, charges = atoi(row[1]); slot = atoi(row[2]); myitem = GetItem(itemid); - if(!myitem) + if(!myitem) continue; ItemInst* myinst = CreateBaseItem(myitem, charges); if(slot < 0)