mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
feat(Core/Gameobject): add a range check for gameobjects (#7521)
This commit is contained in:
@@ -2058,8 +2058,10 @@ GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, GameobjectTy
|
||||
{
|
||||
if (go->GetGoType() == type)
|
||||
{
|
||||
if (go->IsWithinDistInMap(this, go->GetInteractionDistance()))
|
||||
if (go->IsWithinDistInMap(this))
|
||||
{
|
||||
return go;
|
||||
}
|
||||
|
||||
LOG_DEBUG("maps", "IsGameObjectOfTypeInRange: GameObject '%s' [%s] is too far away from player %s [%s] to be used by him (distance=%f, maximal 10 is allowed)",
|
||||
go->GetGOInfo()->name.c_str(), go->GetGUID().ToString().c_str(), GetName().c_str(), GetGUID().ToString().c_str(), go->GetDistance(this));
|
||||
@@ -7472,7 +7474,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||
|
||||
// not check distance for GO in case owned GO (fishing bobber case, for example)
|
||||
// And permit out of range GO with no owner in case fishing hole
|
||||
if (!go || (loot_type != LOOT_FISHINGHOLE && ((loot_type != LOOT_FISHING && loot_type != LOOT_FISHING_JUNK) || go->GetOwnerGUID() != GetGUID()) && !go->IsWithinDistInMap(this, INTERACTION_DISTANCE)) || (loot_type == LOOT_CORPSE && go->GetRespawnTime() && go->isSpawnedByDefault()))
|
||||
if (!go || (loot_type != LOOT_FISHINGHOLE && ((loot_type != LOOT_FISHING && loot_type != LOOT_FISHING_JUNK) || go->GetOwnerGUID() != GetGUID()) && !go->IsWithinDistInMap(this)) || (loot_type == LOOT_CORPSE && go->GetRespawnTime() && go->isSpawnedByDefault()))
|
||||
{
|
||||
go->ForceValuesUpdateAtIndex(GAMEOBJECT_BYTES_1);
|
||||
SendLootRelease(guid);
|
||||
|
||||
Reference in New Issue
Block a user