Core: Fix build and proper deinitialization in HandleTransmogrifyItems (by using vectors instead of new/delete)

This commit is contained in:
Nay committed 2012-08-10 02:57:16 +01:00
1 parent 260782f316
commit 5e1e9bb4dd
6 files changed
+54 -64

No files matched your search

+3 -8
View File
@@ -1454,9 +1454,9 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData)
return;
}
ObjectGuid* itemGuids = new ObjectGuid[count];
uint32* newEntries = new uint32[count];
uint32* slots = new uint32[count];
std::vector<ObjectGuid> itemGuids(count, ObjectGuid(0));
std::vector<uint32> newEntries(count, 0);
std::vector<uint32> slots(count, 0);
for (uint8 i = 0; i < count; ++i)
{
@@ -1606,11 +1606,6 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData)
// ... unless client was modified
if (cost) // 0 cost if reverting look
player->ModifyMoney(-cost);
delete[] itemGuids;
delete[] newEntries;
delete[] slots;
}
void WorldSession::SendReforgeResult(bool success)