Fix starting items for starting_item entries that use slot -1 to find a free slot

This commit is contained in:
akkadius 2014-09-22 16:23:43 -05:00
parent fee8a1214a
commit 1170b57fd5
2 changed files with 19 additions and 8 deletions

View File

@ -708,7 +708,9 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
/* This only for new Character creation storing */ /* This only for new Character creation storing */
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inventory* inv) { 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); charid = GetCharacterID(pp->name);
if(!charid) { if(!charid) {
@ -749,9 +751,18 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
#endif #endif
} }
if (i == MainCursor) { i = EmuConstants::GENERAL_BAGS_BEGIN; continue; } if (i == MainCursor) {
else if (i == EmuConstants::CURSOR_BAG_END) { i = EmuConstants::BANK_BEGIN; continue; } i = EmuConstants::GENERAL_BAGS_BEGIN;
else if (i == EmuConstants::BANK_END) { i = EmuConstants::BANK_BAGS_BEGIN; continue; } 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++; i++;
} }
return true; return true;

View File

@ -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) { 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; const Item_Struct* myitem;
uint32 itemid = 0; uint32 itemid = 0;
uint32 charges = 0; int32 charges = 0;
uint32 slot = 0; int32 slot = 0;
auto query = StringFormat( auto query = StringFormat(
"SELECT `itemid`, `item_charges`, `slot` FROM `starting_items`" "SELECT `itemid`, `item_charges`, `slot` FROM `starting_items`"
" WHERE (`race` = %i OR `race` = 0)" " WHERE (`race` = %i OR `race` = 0)"