From 33f3397976aafca09d67c039aa64be4e94a585b9 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 23 Jun 2011 02:39:36 +0200 Subject: Core/Spells: Completely remove spells which were taught by SPELL_EFFECT_LEARN_SPELL on talent reset or talent spec switch - instead of keeping them stored as disabled. Reason for this is that if the primary spell with effect SPELL_EFFECT_LEARN_SPELL is learnt again, a 'new' secondary spell will be taught while the old one was still around. The latter was the reason for primary key violations in character_spell that led to transaction failures and thus character rollbacks. Closes #1231 Closes #480 --- src/server/game/Entities/Player/Player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 81ab2ac0f13..1c3bc04b46c 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4405,7 +4405,7 @@ bool Player::resetTalents(bool no_cost) if (const SpellEntry *_spellEntry = sSpellStore.LookupEntry(talentInfo->RankID[rank])) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellEntry for valid trigger spells if (_spellEntry->EffectTriggerSpell[i] > 0 && _spellEntry->Effect[i] == SPELL_EFFECT_LEARN_SPELL) - removeSpell(_spellEntry->EffectTriggerSpell[i], true); // and remove any spells that the talent teaches + removeSpell(_spellEntry->EffectTriggerSpell[i]); // and remove any spells that the talent teaches // if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]); if (plrTalent != m_talents[m_activeSpec]->end()) @@ -24289,7 +24289,7 @@ void Player::ActivateSpec(uint8 spec) if (const SpellEntry *_spellEntry = sSpellStore.LookupEntry(talentInfo->RankID[rank])) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellEntry for valid trigger spells if (_spellEntry->EffectTriggerSpell[i] > 0 && _spellEntry->Effect[i] == SPELL_EFFECT_LEARN_SPELL) - removeSpell(_spellEntry->EffectTriggerSpell[i], true); // and remove any spells that the talent teaches + removeSpell(_spellEntry->EffectTriggerSpell[i]); // and remove any spells that the talent teaches // if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted //PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]); //if (plrTalent != m_talents[m_activeSpec]->end()) -- cgit v1.2.3