aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-04-04 15:42:58 -0300
committerariel- <ariel-@users.noreply.github.com>2018-04-04 15:42:58 -0300
commita413e7dee95e39d77b433b6726988d9f049377ad (patch)
tree2206e7e4ae55ff0b47928a5f3921677d0c786fbb /src
parent6464420b27d3b1e3f47bb79f95206f4ddf188f9d (diff)
Core/Player: partial revert of m_items handling as it's cause of a exploit
Closes #21760
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index ea4881957b5..221b12a5d57 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -7239,7 +7239,6 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply, bool updateItemA
return;
ItemTemplate const* proto = item->GetTemplate();
-
if (!proto)
return;
@@ -7540,7 +7539,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
HandleStatFlatModifier(UNIT_MOD_RESISTANCE_ARCANE, BASE_VALUE, float(proto->ArcaneRes), apply);
WeaponAttackType attType = Player::GetAttackBySlot(slot);
- if (attType != MAX_ATTACK && CanUseAttackType(attType))
+ if (attType != MAX_ATTACK)
_ApplyWeaponDamage(slot, proto, apply);
// Druids get feral AP bonus from weapon dps (also use DPS from ScalingStatValue)
@@ -7563,7 +7562,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, bool apply)
{
WeaponAttackType attType = Player::GetAttackBySlot(slot);
- if (attType == MAX_ATTACK)
+ if (!IsInFeralForm() && apply && !CanUseAttackType(attType))
return;
ScalingStatValuesEntry const* ssv = GetScalingStatValuesFor(*proto);
@@ -12209,8 +12208,6 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
if (pProto->ItemSet)
RemoveItemsSetItem(this, pProto);
- // remove here before _ApplyItemMods (for example to register correct damages of unequipped weapon)
- m_items[slot] = nullptr;
_ApplyItemMods(pItem, slot, false, update);
// remove item dependent auras and casts (only weapon and armor slots)
@@ -12246,9 +12243,8 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
}
}
}
- else
- m_items[slot] = nullptr;
+ m_items[slot] = nullptr;
SetGuidValue(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), ObjectGuid::Empty);
if (slot < EQUIPMENT_SLOT_END)
@@ -12358,9 +12354,6 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
if (pProto->ItemSet)
RemoveItemsSetItem(this, pProto);
- // clear m_items so weapons for example can be registered as unequipped
- m_items[slot] = nullptr;
-
_ApplyItemMods(pItem, slot, false);
}
@@ -12386,9 +12379,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
SetVisibleItemSlot(slot, nullptr);
}
- // clear for rest of items (ie nonequippable)
- if (slot >= INVENTORY_SLOT_BAG_END)
- m_items[slot] = nullptr;
+ m_items[slot] = nullptr;
}
else if (Bag* pBag = GetBagByPos(bag))
pBag->RemoveItem(slot, update);