mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7688] Move Get*IfCanInteractWith to Player including renamed IsGameObjectOfTypeInRange.
This commit is contained in:
parent
82b0ff8b5d
commit
f4adf83cd7
16 changed files with 134 additions and 116 deletions
|
|
@ -4166,23 +4166,6 @@ void ObjectMgr::LoadInstanceTemplate()
|
|||
sLog.outString();
|
||||
}
|
||||
|
||||
bool ObjectMgr::IsGameObjectOfTypeInRange(Player *player, uint64 guid, GameobjectTypes type) const
|
||||
{
|
||||
if(GameObject *go = ObjectAccessor::GetGameObject(*player, guid))
|
||||
{
|
||||
if(go->GetGoType() == type)
|
||||
{
|
||||
// TODO: find out how the client calculates the maximal usage distance to spellless working
|
||||
// gameobjects like guildbanks and mailboxes - 10.0 is a just an abitrary choosen number
|
||||
if (go->IsWithinDistInMap(player, 10.0f))
|
||||
return true;
|
||||
sLog.outError("IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name,
|
||||
go->GetGUIDLow(), player->GetName(), player->GetGUIDLow(), go->GetDistance(player));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
GossipText const *ObjectMgr::GetGossipText(uint32 Text_ID) const
|
||||
{
|
||||
GossipTextMap::const_iterator itr = mGossipText.find(Text_ID);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue