This commit is contained in:
VladimirMangos 2010-03-13 16:12:13 +03:00
parent 8416702d7c
commit 2bf75e7a10
6 changed files with 26 additions and 24 deletions

View file

@ -2124,10 +2124,10 @@ void Player::RegenerateHealth(uint32 diff)
ModifyHealth(int32(addvalue));
}
Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask)
Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
{
// unit checks
if (!guid || !IsInWorld() || isInFlight())
// some basic checks
if (guid.IsEmpty() || !IsInWorld() || isInFlight())
return NULL;
// exist (we need look pets also for some interaction (quest/etc)
@ -2174,8 +2174,12 @@ Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask)
return unit;
}
GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, uint32 gameobject_type) const
GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameobject_type) const
{
// some basic checks
if (guid.IsEmpty() || !IsInWorld() || isInFlight())
return NULL;
if (GameObject *go = GetMap()->GetGameObject(guid))
{
if (uint32(go->GetGoType()) == gameobject_type || gameobject_type == MAX_GAMEOBJECT_TYPE)