From 02440eaa106834edbf36cedad13a3badc6a09abe Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 25 Mar 2009 16:04:08 -0600 Subject: [7538] Hide some implementation details for reputation/forced faction reaction. Author: VladimirMangos --HG-- branch : trunk --- src/game/ObjectAccessor.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/game/ObjectAccessor.cpp') diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index c245b09f410..14ee90ef3e5 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -81,13 +81,11 @@ ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint3 return NULL; // not unfriendly - FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(unit->getFaction()); - if(factionTemplate) - { - FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction); - if( faction && faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY) - return NULL; - } + if(FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(unit->getFaction())) + if(factionTemplate->faction) + if(FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) + if(faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY) + return NULL; // not too far if(!unit->IsWithinDistInMap(&player,INTERACTION_DISTANCE)) -- cgit v1.2.3