diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 7 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/UnitDefines.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 23d06007908..4f911497d4f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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)) diff --git a/src/server/game/Entities/Unit/UnitDefines.h b/src/server/game/Entities/Unit/UnitDefines.h index 36307f7074d..0a6dd35a0c9 100644 --- a/src/server/game/Entities/Unit/UnitDefines.h +++ b/src/server/game/Entities/Unit/UnitDefines.h @@ -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 |