Core/Items: Fixed a reforge exploit

That allowed items to be reforged more than once.
Thanks @Rochet2
Closes #11465
This commit is contained in:
Sebastian Valle Herrera
2014-06-07 19:18:54 -05:00
parent 73e90f6241
commit cfd527c880

View File

@@ -1581,6 +1581,13 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData)
if (!reforgeEntry)
{
if (!item->GetEnchantmentId(REFORGE_ENCHANTMENT_SLOT))
{
TC_LOG_ERROR("network", "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to remove reforge from non-reforged item (Entry: %u)", player->GetGUIDLow(), player->GetName().c_str(), item->GetEntry());
SendReforgeResult(false);
return;
}
// Reset the item
if (item->IsEquipped())
player->ApplyReforgeEnchantment(item, false);
@@ -1589,6 +1596,13 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData)
return;
}
if (item->GetEnchantmentId(REFORGE_ENCHANTMENT_SLOT))
{
TC_LOG_ERROR("network", "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an already reforged item (Entry: %u)", player->GetGUIDLow(), player->GetName().c_str(), item->GetEntry());
SendReforgeResult(false);
return;
}
ItemReforgeEntry const* stats = sItemReforgeStore.LookupEntry(reforgeEntry);
if (!stats)
{