aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-01-02 01:19:23 -0300
committerfunjoker <funjoker109@gmail.com>2021-05-06 07:06:27 +0200
commitb11c1e714184be6abeef61f38117c5c66c5d903e (patch)
tree707b79a8a66d8341aa9bd41fa577e1c3205c7945 /src
parentea52958411c1ba2b85113f067032ddcccd487cbf (diff)
Core/Player: fix issue with SendLoot when using Disarm Trap at maximum range
(cherry picked from commit a0dcd9c7988912e97909df2ba9ab0b86d20ff22d)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 003510f3c91..4507a8a8d7d 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -8731,10 +8731,32 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, bool aeLooting/* = fa
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;
+
+ 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;
+ };
- // 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 (shouldLootRelease(go, loot_type))
{
SendLootRelease(guid);
return;