Core/Loothandling: Make sure "pet-only"-kills doesn't drop loot (when pet is killing a creature on its own without any assistance from player)
(Also fix unintended typo from r701f212a00) --HG-- branch : trunk
This commit is contained in:
@@ -966,6 +966,9 @@ void Creature::SetLootRecipient(Unit *unit)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unit->GetTypeId() != TYPEID_PLAYER && !unit->IsVehicle())
|
||||||
|
return;
|
||||||
|
|
||||||
Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself();
|
Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||||
if (!player) // normal creature, no player involved
|
if (!player) // normal creature, no player involved
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -8457,13 +8457,10 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// the player whose group may loot the corpse
|
|
||||||
Player *recipient = creature->GetLootRecipient();
|
Player *recipient = creature->GetLootRecipient();
|
||||||
|
|
||||||
if (!recipient)
|
if (!recipient)
|
||||||
{
|
return;
|
||||||
creature->SetLootRecipient(this);
|
|
||||||
recipient = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!creature->lootForBody)
|
if (!creature->lootForBody)
|
||||||
{
|
{
|
||||||
@@ -16492,8 +16489,7 @@ bool Player::isAllowedToLoot(const Creature* creature)
|
|||||||
|
|
||||||
Player* recipient = creature->GetLootRecipient();
|
Player* recipient = creature->GetLootRecipient();
|
||||||
if (!recipient)
|
if (!recipient)
|
||||||
// prevent other players from looting if the recipient got disconnected
|
return false;
|
||||||
return !creature->hasLootRecipient();
|
|
||||||
|
|
||||||
Group* recipientGroup = recipient->GetGroup();
|
Group* recipientGroup = recipient->GetGroup();
|
||||||
if (!recipientGroup)
|
if (!recipientGroup)
|
||||||
|
|||||||
@@ -15279,7 +15279,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
|||||||
// only if not player and not controlled by player pet. And not at BG
|
// only if not player and not controlled by player pet. And not at BG
|
||||||
if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
|
if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
|
||||||
{
|
{
|
||||||
sLog.outStaticDebug("We are dead, loosing %f percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
sLog.outStaticDebug("We are dead, losing %f percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||||
pVictim->ToPlayer()->DurabilityLossAll(sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH),false);
|
pVictim->ToPlayer()->DurabilityLossAll(sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH),false);
|
||||||
// durability lost message
|
// durability lost message
|
||||||
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
|
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user