diff options
author | QAston <none@none> | 2010-01-31 17:24:13 +0100 |
---|---|---|
committer | QAston <none@none> | 2010-01-31 17:24:13 +0100 |
commit | ac388e6f214ff02c504c5ea8af7c1c468bf07406 (patch) | |
tree | 5c40909de90de1296f73c4d98d940c8879ce7c98 /src/game/Creature.h | |
parent | d435366bceaf6f04dfe226e0838c2893519db5be (diff) |
*Add support for spells in npc_trainer table with multiple SPELL_EFFECT_LEARN_SPELL, this fixes problems with learning such spells from trainers.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.h')
-rw-r--r-- | src/game/Creature.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game/Creature.h b/src/game/Creature.h index 58974fe0c83..e7ddd64a7bb 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -370,21 +370,21 @@ typedef std::list<VendorItemCount> VendorItemCounts; struct TrainerSpell { - TrainerSpell() : spell(0), spellCost(0), reqSkill(0), reqSkillValue(0), reqLevel(0), learnedSpell(0) {} - - TrainerSpell(uint32 _spell, uint32 _spellCost, uint32 _reqSkill, uint32 _reqSkillValue, uint32 _reqLevel, uint32 _learnedspell) - : spell(_spell), spellCost(_spellCost), reqSkill(_reqSkill), reqSkillValue(_reqSkillValue), reqLevel(_reqLevel), learnedSpell(_learnedspell) - {} + TrainerSpell() : spell(0), spellCost(0), reqSkill(0), reqSkillValue(0), reqLevel(0) + { + for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + learnedSpell[i] = 0; + } uint32 spell; uint32 spellCost; uint32 reqSkill; uint32 reqSkillValue; uint32 reqLevel; - uint32 learnedSpell; + uint32 learnedSpell[3]; // helpers - bool IsCastable() const { return learnedSpell != spell; } + bool IsCastable() const { return learnedSpell[0] != spell; } }; typedef UNORDERED_MAP<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap; |