From a96c7e85c5c6603c393d7fe278a275c4266b0460 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Wed, 23 Jul 2025 15:49:29 +0000 Subject: [PATCH] fix(Core/Player): Only mark spells as invalid when none of the Skills match (#22537) --- src/server/game/Entities/Player/Player.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 056f8ced1..7173ad844 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3104,22 +3104,26 @@ bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool bool Player::CheckSkillLearnedBySpell(uint32 spellId) { SkillLineAbilityMapBounds skill_bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); + uint32 errorSkill = 0; for (SkillLineAbilityMap::const_iterator sla = skill_bounds.first; sla != skill_bounds.second; ++sla) { SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(sla->second->SkillLine); if (!pSkill) continue; - SkillRaceClassInfoEntry const* rcEntry = GetSkillRaceClassInfo(pSkill->id, getRace(), getClass()); - if (!rcEntry) - { - LOG_ERROR("entities.player", "Player {} (GUID: {}), has spell ({}) that teach skill ({}) which is invalid for the race/class combination (Race: {}, Class: {}). Will be deleted.", - GetName(), GetGUID().GetCounter(), spellId, pSkill->id, getRace(), getClass()); - - return false; - } + if (GetSkillRaceClassInfo(pSkill->id, getRace(), getClass())) + return true; + else + errorSkill = pSkill->id; } + if (errorSkill) + { + LOG_ERROR("entities.player", "Player {} (GUID: {}), has spell ({}) that teach skill ({}) which is invalid for the race/class combination (Race: {}, Class: {}). Will be deleted.", + GetName(), GetGUID().GetCounter(), spellId, errorSkill, getRace(), getClass()); + + return false; + } return true; }