diff options
author | megamage <none@none> | 2009-04-19 18:23:10 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-19 18:23:10 -0500 |
commit | f9befe1d3db1769c9cfeb6898504c95ca58c2316 (patch) | |
tree | b4037c4eefb6b2c97a93fddff4115921178ff1be /src/game/ObjectAccessor.cpp | |
parent | 3d62e6f07d956b515f681642a67a9efbf9a013f6 (diff) |
[7688] Move Get*IfCanInteractWith to Player including renamed IsGameObjectOfTypeInRange. Author: VladimirMangos
--HG--
branch : trunk
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)) |