Revert "fix(Core/Player): Make sure OnEquip spells from items are added after revive" (#24352)

This commit is contained in:
sudlud
2026-01-08 10:49:19 +01:00
committed by GitHub
parent a1f5d39370
commit ddb9c515b6
4 changed files with 1 additions and 33 deletions

View File

@@ -272,13 +272,6 @@ public:
[[nodiscard]] uint32 GetCount() const { return GetUInt32Value(ITEM_FIELD_STACK_COUNT); } [[nodiscard]] uint32 GetCount() const { return GetUInt32Value(ITEM_FIELD_STACK_COUNT); }
void SetCount(uint32 value) { SetUInt32Value(ITEM_FIELD_STACK_COUNT, value); } void SetCount(uint32 value) { SetUInt32Value(ITEM_FIELD_STACK_COUNT, value); }
[[nodiscard]] uint32 GetMaxStackCount() const { return GetTemplate()->GetMaxStackSize(); } [[nodiscard]] uint32 GetMaxStackCount() const { return GetTemplate()->GetMaxStackSize(); }
void GetOnEquipSpellIDs(std::vector<uint32>& spellEquipID) const
{
if (ItemTemplate const* proto = GetTemplate())
proto->GetOnEquipSpellIDs(spellEquipID);
else
spellEquipID.clear();
};
// Checks if this item has sockets, whether built-in or added by an upgrade. // Checks if this item has sockets, whether built-in or added by an upgrade.
[[nodiscard]] bool HasSocket() const; [[nodiscard]] bool HasSocket() const;
[[nodiscard]] uint8 GetGemCountWithID(uint32 GemID) const; [[nodiscard]] uint8 GetGemCountWithID(uint32 GemID) const;

View File

@@ -729,14 +729,6 @@ struct ItemTemplate
return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF - 1) : uint32(Stackable); return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF - 1) : uint32(Stackable);
} }
void GetOnEquipSpellIDs(std::vector<uint32>& spellEquipID) const
{
spellEquipID.clear();
for (auto const& spell : Spells)
if (spell.SpellId && spell.SpellTrigger == ITEM_SPELLTRIGGER_ON_EQUIP)
spellEquipID.push_back(spell.SpellId);
}
[[nodiscard]] float getDPS() const [[nodiscard]] float getDPS() const
{ {
if (Delay == 0) if (Delay == 0)

View File

@@ -319,23 +319,6 @@ void Player::Update(uint32 p_time)
{ {
m_regenTimer += p_time; m_regenTimer += p_time;
RegenerateAll(); RegenerateAll();
// Apply buffs from items with Apply on Equip trigger if they are not present.
for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i)
{
if (!m_items[i])
continue;
std::vector<uint32> spellIDs;
m_items[i]->GetOnEquipSpellIDs(spellIDs);
bool apply = false;
for (uint32 spellID : spellIDs)
if (!apply && !HasAura(spellID))
apply = true;
if (apply)
ApplyItemEquipSpell(m_items[i], true, false);
}
} }
if (m_deathState == DeathState::JustDied) if (m_deathState == DeathState::JustDied)

View File

@@ -14711,7 +14711,7 @@ void Unit::setDeathState(DeathState s, bool despawn)
} }
else if (s == DeathState::JustRespawned) else if (s == DeathState::JustRespawned)
{ {
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground)
} }
} }