diff options
Diffstat (limited to 'src/game/ObjectAccessor.cpp')
-rw-r--r-- | src/game/ObjectAccessor.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 4df45812f7f..829fd44d1dc 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -49,52 +49,6 @@ ObjectAccessor::ObjectAccessor() {} ObjectAccessor::~ObjectAccessor() {} Creature* -ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint32 npcflagmask) -{ - // unit checks - if (!guid) - return NULL; - - // exist - Creature *unit = GetCreature(player, guid); - if (!unit) - return NULL; - - // player check - if(!player.CanInteractWithNPCs(!unit->isSpiritService())) - return NULL; - - // appropriate npc type - if(npcflagmask && !unit->HasFlag( UNIT_NPC_FLAGS, npcflagmask )) - return NULL; - - // alive or spirit healer - if(!unit->isAlive() && (!unit->isSpiritService() || player.isAlive() )) - return NULL; - - // not allow interaction under control - if(unit->GetCharmerOrOwnerGUID()) - return NULL; - - // not enemy - if( unit->IsHostileTo(&player)) - return NULL; - - // not unfriendly - if(FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(unit->getFaction())) - if(factionTemplate->faction) - if(FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) - if(faction->reputationListID >= 0 && player.GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) - return NULL; - - // not too far - if(!unit->IsWithinDistInMap(&player,INTERACTION_DISTANCE)) - return NULL; - - return unit; -} - -Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const &u, uint64 guid) { if(Creature *unit = GetPet(guid)) |