diff options
| author | Trazom62 <none@none> | 2010-01-31 18:10:27 +0100 |
|---|---|---|
| committer | Trazom62 <none@none> | 2010-01-31 18:10:27 +0100 |
| commit | 5114a2a3274d1d7afe9f6db5aa2c9d5f41a061c7 (patch) | |
| tree | a04a5c8a029972385b69291a4065a7e9c9f69936 /src | |
| parent | 9de5acc4e103058356c7dc410789dde34e7bcc8e (diff) | |
Fix Metagem bug exploit. Thanks Azazel and p.alexej.
Fixes issue #579.
Fixes issue #453.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Player.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index af898061aea..529dbd16274 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -6888,14 +6888,19 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply) if(slot >= INVENTORY_SLOT_BAG_END || !item) return; - // not apply mods for broken item - if(item->IsBroken()) + ItemPrototype const *proto = item->GetProto(); + + if (!proto) return; - ItemPrototype const *proto = item->GetProto(); + // not apply mods for broken item + if (item->IsBroken()) + { + if (proto->Socket[0].Color) + CorrectMetaGemEnchants(slot, apply); - if(!proto) return; + } sLog.outDetail("applying mods for item %u ",item->GetGUIDLow()); @@ -19410,10 +19415,10 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) //counting current equipped gem colors for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) { - if(i == slot) + if (i == slot) continue; - Item *pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, i ); - if(pItem2 && pItem2->GetProto()->Socket[0].Color) + Item *pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem2 && !pItem2->IsBroken() && pItem2->GetProto()->Socket[0].Color) { for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { |
