aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2011-06-23 02:39:36 +0200
committerMachiavelli <machiavelli.trinity@gmail.com>2011-06-23 02:39:36 +0200
commit33f3397976aafca09d67c039aa64be4e94a585b9 (patch)
treee1951189dfe5f40eb64833646e2cabfbdb75df1a
parent719a079464dc43e64e4b71bc74b2d7282ad94eb7 (diff)
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
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp4
1 files changed, 2 insertions, 2 deletions
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())