aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2010-01-16 19:21:07 +0300
committern0n4m3 <none@none>2010-01-16 19:21:07 +0300
commit15dc23ad45f20e147dcfc01abd94b438cc0318ea (patch)
treedb5127244215fc1113bce6ac2843a661ff2f97f3 /src
parent9be16cf605d1b565ad4e84badbb61c1b121fee1f (diff)
Fixed item dupe and apply enchantment while disarm state original patch by zhenya.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index e97731fc754..898f0f08f01 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -9588,6 +9588,9 @@ uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem,
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
+ if (pItem && pItem->m_lootGenerated)
+ return EQUIP_ERR_ALREADY_LOOTED;
+
// no maximum
if (pProto->MaxCount <= 0 && pProto->ItemLimitCategory == 0 || pProto->MaxCount == 2147483647)
return EQUIP_ERR_OK;
@@ -12554,6 +12557,9 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
if (!item->IsEquipped())
return;
+ if (!CanUseAttackType(Player::GetAttackBySlot(item->GetSlot())))
+ return;
+
if (slot >= MAX_ENCHANTMENT_SLOT)
return;