diff --git a/src/game/Handlers/LootHandler.cpp b/src/game/Handlers/LootHandler.cpp index b078039675e..96edaedbe78 100644 --- a/src/game/Handlers/LootHandler.cpp +++ b/src/game/Handlers/LootHandler.cpp @@ -97,12 +97,30 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recv_data) bool ok_loot = pCreature && pCreature->IsAlive() == (player->GetClass() == CLASS_ROGUE && pCreature->lootForPickPocketed); - if (!ok_loot || !pCreature->IsWithinDistInMap(_player, _player->GetMaxLootDistance(pCreature), true, SizeFactor::None)) + if (!ok_loot) { - player->SendLootRelease(lguid); + player->SendLootError(lguid, LOOT_ERROR_DIDNT_KILL); return; } + // skinning uses the spell range which is 5 yards + if (pCreature->lootForSkin) + { + if (!pCreature->IsWithinCombatDistInMap(player, INTERACTION_DISTANCE + 1.25f)) + { + player->SendLootError(lguid, LOOT_ERROR_TOO_FAR); + return; + } + } + else + { + if (!pCreature->IsWithinDistInMap(_player, _player->GetMaxLootDistance(pCreature), true, SizeFactor::None)) + { + player->SendLootError(lguid, LOOT_ERROR_TOO_FAR); + return; + } + } + loot = &pCreature->loot; break; } diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index 9bb9c409ab1..6b1d2eb8134 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -8317,11 +8317,12 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player const* pVictim // must be in range and creature must be alive for pickpocket and must be dead for another loot if (!creature || creature->IsAlive() != (loot_type == LOOT_PICKPOCKETING)) { - SendLootRelease(guid); + SendLootError(guid, LOOT_ERROR_DIDNT_KILL); return; } - if (!creature->IsWithinDistInMap(this, GetMaxLootDistance(creature), true, SizeFactor::None)) + // skinning range already checked during spell cast + if (loot_type != LOOT_SKINNING && !creature->IsWithinDistInMap(this, GetMaxLootDistance(creature), true, SizeFactor::None)) { SendLootError(guid, LOOT_ERROR_TOO_FAR); return; diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 531b2d65485..133eff1fd7d 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -6567,11 +6567,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (!creature->IsSkinnableBy(m_caster->ToPlayer())) return SPELL_FAILED_TARGET_NOT_LOOTED; - // If the player isn't in loot range, the skins are lost forever. - // This only happens on large mobs with disjointed models (i.e. Devilsaurs). - if (!creature->IsWithinDistInMap(m_caster, INTERACTION_DISTANCE)) - return SPELL_FAILED_OUT_OF_RANGE; - int32 skillValue = ((Player*)m_caster)->GetSkillValue(SKILL_SKINNING); int32 TargetLevel = m_targets.getUnitTarget()->GetLevel(); int32 ReqValue = (skillValue < 100 ? (TargetLevel - 10) * 10 : TargetLevel * 5);