mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 06:00:10 -04:00
Core/Player: fix issue with SendLoot when using Disarm Trap at maximum range
This commit is contained in:
@@ -8344,10 +8344,32 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||
if (guid.IsGameObject())
|
||||
{
|
||||
GameObject* go = GetMap()->GetGameObject(guid);
|
||||
auto shouldLootRelease = [this](GameObject* go, LootType lootType) -> bool
|
||||
{
|
||||
// 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)
|
||||
return true;
|
||||
|
||||
// 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 (lootType == LOOT_SKINNING)
|
||||
{
|
||||
// Disarm Trap
|
||||
if (!go->IsWithinDistInMap(this, 20.f))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lootType != LOOT_FISHINGHOLE && ((lootType != LOOT_FISHING && lootType != LOOT_FISHING_JUNK) || go->GetOwnerGUID() != GetGUID()) && !go->IsWithinDistInMap(this, INTERACTION_DISTANCE))
|
||||
return true;
|
||||
|
||||
if (lootType == LOOT_CORPSE && go->GetRespawnTime() && go->isSpawnedByDefault())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
if (shouldLootRelease(go, loot_type))
|
||||
{
|
||||
SendLootRelease(guid);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user