Core/Players: Fixed learning talents available for multiple specs but in different row/column

This commit is contained in:
Shauren
2018-03-26 17:20:09 +02:00
parent 0be08dd79c
commit f74212c8b8
2 changed files with 6 additions and 2 deletions

View File

@@ -26109,7 +26109,7 @@ TalentLearnResult Player::LearnTalent(uint32 talentId, int32* spellOnCooldown)
if (IsInCombat())
return TALENT_FAILED_AFFECTING_COMBAT;
if (isDead() || GetMap()->IsBattlegroundOrArena())
if (isDead())
return TALENT_FAILED_CANT_DO_THAT_RIGHT_NOW;
if (!GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID))
@@ -26158,7 +26158,10 @@ TalentLearnResult Player::LearnTalent(uint32 talentId, int32* spellOnCooldown)
{
for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(getClass(), talentInfo->TierID, c))
{
if (HasTalent(talent->ID, GetActiveTalentGroup()) && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
if (!HasTalent(talent->ID, GetActiveTalentGroup()))
continue;
if (!HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHANGING_TALENTS))
return TALENT_FAILED_REST_AREA;
if (GetSpellHistory()->HasCooldown(talent->SpellID))

View File

@@ -216,6 +216,7 @@ enum UnitFlags2 : uint32
UNIT_FLAG2_FORCE_MOVEMENT = 0x00000040,
UNIT_FLAG2_DISARM_OFFHAND = 0x00000080,
UNIT_FLAG2_DISABLE_PRED_STATS = 0x00000100, // Player has disabled predicted stats (Used by raid frames)
UNIT_FLAG2_ALLOW_CHANGING_TALENTS = 0x00000200, // Allows changing talents outside rest area
UNIT_FLAG2_DISARM_RANGED = 0x00000400, // this does not disable ranged weapon display (maybe additional flag needed?)
UNIT_FLAG2_REGENERATE_POWER = 0x00000800,
UNIT_FLAG2_RESTRICT_PARTY_INTERACTION = 0x00001000, // Restrict interaction to party or raid