aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpete318 <pete318@hotmail.com>2014-12-28 18:59:05 +0000
committerNayd <dnpd.dd@gmail.com>2014-12-28 19:04:20 +0000
commitfe3772df740b8023c7c047f676f6798c99db8cf8 (patch)
treeecfd52a76f7c3bc9876b1c8c7b018d475ec4973b
parent27137ca06e99209bd1a47a0ff7082ff14fcae8c9 (diff)
Core: NPC Interaction change for unfriendly reputation.
For units with unfriendly reputation, check using the normal reaction function, instead of reading faction directly. This allows specific buffs that alter creature reaction to work on the player, this allowing players to complete quests. Closes #13629 (cherry picked from commit 17f6dcb76282523ac43d8a1e6cebbe0043ab44fa) Conflicts: src/server/game/Entities/Player/Player.cpp
-rw-r--r--src/server/game/Entities/Player/Player.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 904600a2481..67ff5377c3e 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -2640,17 +2640,10 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
if (!creature->GetCharmerGUID().IsEmpty())
return NULL;
- // not enemy
- if (creature->IsHostileTo(this))
+ // not unfriendly/hostile
+ if (creature->GetReactionTo(this) <= REP_UNFRIENDLY)
return NULL;
- // not unfriendly
- if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction()))
- if (factionTemplate->Faction)
- if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->Faction))
- if (faction->ReputationIndex >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY)
- return NULL;
-
// not too far
if (!creature->IsWithinDistInMap(this, INTERACTION_DISTANCE))
return NULL;