diff options
author | Shauren <shauren.trinity@gmail.com> | 2016-08-24 16:30:49 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2016-08-24 16:30:49 +0200 |
commit | 2017c515de588e652846fa1781cfbad64f4aaa15 (patch) | |
tree | 0105746a80ba1d894e938399cc33c4df170001da /src | |
parent | 3c6c78da1ce1753bbd9f8ae32d6ddc4c87edb778 (diff) |
Core/Items: Removed old stupid code dropping enchantment charges when sheathing weapons...
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 48 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.h | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 2 |
3 files changed, 1 insertions, 51 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index cc78ab78c9b..ef57ffdb334 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9243,54 +9243,6 @@ void Player::ResetPetTalents() /*** STORAGE SYSTEM ***/ /*********************************************************/ -void Player::SetVirtualItemSlot(uint8 i, Item* item) -{ - ASSERT(i < 3); - if (i < 2 && item) - { - if (!item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)) - return; - uint32 charges = item->GetEnchantmentCharges(TEMP_ENCHANTMENT_SLOT); - if (charges == 0) - return; - if (charges > 1) - item->SetEnchantmentCharges(TEMP_ENCHANTMENT_SLOT, charges-1); - else if (charges <= 1) - { - ApplyEnchantment(item, TEMP_ENCHANTMENT_SLOT, false); - item->ClearEnchantment(TEMP_ENCHANTMENT_SLOT); - } - } -} - -void Player::SetSheath(SheathState sheathed) -{ - switch (sheathed) - { - case SHEATH_STATE_UNARMED: // no prepared weapon - SetVirtualItemSlot(0, nullptr); - SetVirtualItemSlot(1, nullptr); - SetVirtualItemSlot(2, nullptr); - break; - case SHEATH_STATE_MELEE: // prepared melee weapon - SetVirtualItemSlot(0, GetWeaponForAttack(BASE_ATTACK, true)); - SetVirtualItemSlot(1, GetWeaponForAttack(OFF_ATTACK, true)); - SetVirtualItemSlot(2, nullptr); - break; - case SHEATH_STATE_RANGED: // prepared ranged weapon - SetVirtualItemSlot(0, nullptr); - SetVirtualItemSlot(1, nullptr); - SetVirtualItemSlot(2, GetWeaponForAttack(RANGED_ATTACK, true)); - break; - default: - SetVirtualItemSlot(0, nullptr); - SetVirtualItemSlot(1, nullptr); - SetVirtualItemSlot(2, nullptr); - break; - } - Unit::SetSheath(sheathed); // this must visualize Sheath changing for other players... -} - uint8 Player::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) const { uint8 slots[4]; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 421a15729dc..fd044cad8c2 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1322,8 +1322,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player> /*** STORAGE SYSTEM ***/ /*********************************************************/ - void SetVirtualItemSlot(uint8 i, Item* item); - void SetSheath(SheathState sheathed) override; // overwrite Unit version uint8 FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) const; uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = nullptr) const; uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = nullptr) const; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4847723fb9c..a45fb495086 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1479,7 +1479,7 @@ class TC_GAME_API Unit : public WorldObject void ApplyCastTimePercentMod(float val, bool apply); SheathState GetSheath() const { return SheathState(GetByteValue(UNIT_FIELD_BYTES_2, 0)); } - virtual void SetSheath(SheathState sheathed) { SetByteValue(UNIT_FIELD_BYTES_2, 0, sheathed); } + void SetSheath(SheathState sheathed) { SetByteValue(UNIT_FIELD_BYTES_2, 0, sheathed); } // faction template id uint32 getFaction() const { return GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE); } |