summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/sql/updates/db_world/2025_12_05_00.sql (renamed from data/sql/updates/pending_db_world/rev_1764473151733634964.sql)1
-rw-r--r--src/server/game/Entities/Player/Player.cpp28
2 files changed, 23 insertions, 6 deletions
diff --git a/data/sql/updates/pending_db_world/rev_1764473151733634964.sql b/data/sql/updates/db_world/2025_12_05_00.sql
index c1248dcc47..f2564e9ab4 100644
--- a/data/sql/updates/pending_db_world/rev_1764473151733634964.sql
+++ b/data/sql/updates/db_world/2025_12_05_00.sql
@@ -1,3 +1,4 @@
+-- DB update 2025_12_04_00 -> 2025_12_05_00
-- DB/Quest: Westguard Sergeant despawns when leaving Skorn
DELETE FROM `smart_scripts` WHERE `entryorguid` = 24060 AND `source_type` = 0 AND `id` = 2;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 5bcd49fcf3..571817a42b 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -7158,18 +7158,34 @@ void Player::ApplyItemDependentAuras(Item* item, bool apply)
{
if (apply)
{
- PlayerSpellMap const& spells = GetSpellMap();
- for (auto itr = spells.begin(); itr != spells.end(); ++itr)
+ for (auto [spellId, playerSpell]: GetSpellMap())
{
- if (itr->second->State == PLAYERSPELL_REMOVED)
+ if (playerSpell->State == PLAYERSPELL_REMOVED)
+ continue;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ if (!spellInfo || !spellInfo->IsPassive() || spellInfo->EquippedItemClass < 0)
+ continue;
+
+ if (!HasAura(spellId) && HasItemFitToSpellRequirements(spellInfo))
+ AddAura(spellId, this); // no SMSG_SPELL_GO in sniff found
+ }
+
+ // Check talents (they are stored separately from regular spells)
+ for (auto [spellId, playerTalent] : GetTalentMap())
+ {
+ if (playerTalent->State == PLAYERSPELL_REMOVED)
+ continue;
+
+ if (!(playerTalent->IsInSpec(GetActiveSpec())))
continue;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo || !spellInfo->IsPassive() || spellInfo->EquippedItemClass < 0)
continue;
- if (!HasAura(itr->first) && HasItemFitToSpellRequirements(spellInfo))
- AddAura(itr->first, this); // no SMSG_SPELL_GO in sniff found
+ if (!HasAura(spellId) && HasItemFitToSpellRequirements(spellInfo))
+ AddAura(spellId, this);
}
}
else