Core: Random cleanup + compile fix
This commit is contained in:
@@ -309,28 +309,28 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
sAuctionMgr->AddAItem(newItem);
|
||||
auctionHouse->AddAuction(AH);
|
||||
|
||||
for (uint32 i = 0; i < itemsCount; ++i)
|
||||
for (uint32 j = 0; j < itemsCount; ++j)
|
||||
{
|
||||
Item* item = items[i];
|
||||
Item* item2 = items[j];
|
||||
|
||||
if (item->GetCount() == count[i])
|
||||
if (item2->GetCount() == count[j])
|
||||
{
|
||||
_player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true);
|
||||
_player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true);
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
item->DeleteFromInventoryDB(trans);
|
||||
item->SaveToDB(trans);
|
||||
item2->DeleteFromInventoryDB(trans);
|
||||
item2->SaveToDB(trans);
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
else
|
||||
{
|
||||
item->SetCount(item->GetCount() - count[i]);
|
||||
item->SetState(ITEM_CHANGED, _player);
|
||||
_player->ItemRemovedQuestCheck(item->GetEntry(), count[i]);
|
||||
item->SendUpdateToPlayer(_player);
|
||||
item2->SetCount(item2->GetCount() - count[j]);
|
||||
item2->SetState(ITEM_CHANGED, _player);
|
||||
_player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]);
|
||||
item2->SendUpdateToPlayer(_player);
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
item->SaveToDB(trans);
|
||||
item2->SaveToDB(trans);
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user