diff options
| author | click <none@none> | 2010-09-13 22:49:20 +0200 |
|---|---|---|
| committer | click <none@none> | 2010-09-13 22:49:20 +0200 |
| commit | a6efc4dad5d9d48b518c9b61704362cc03050f43 (patch) | |
| tree | d24e9f78c86b21fbb7b757f4c19eb55cdde0b501 /src | |
| parent | 6528a82b612432b9091163e8a9074d424c7e764d (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 10 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ab9c3c28763..4e222aabca1 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -966,6 +966,9 @@ void Creature::SetLootRecipient(Unit *unit) return; } + if (unit->GetTypeId() != TYPEID_PLAYER && !unit->IsVehicle()) + return; + Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself(); if (!player) // normal creature, no player involved return; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ed77a85fdf9..3f165def6f1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8457,13 +8457,10 @@ void Player::SendLoot(uint64 guid, LootType loot_type) } else { - // the player whose group may loot the corpse Player *recipient = creature->GetLootRecipient(); + if (!recipient) - { - creature->SetLootRecipient(this); - recipient = this; - } + return; if (!creature->lootForBody) { @@ -16492,8 +16489,7 @@ bool Player::isAllowedToLoot(const Creature* creature) Player* recipient = creature->GetLootRecipient(); if (!recipient) - // prevent other players from looting if the recipient got disconnected - return !creature->hasLootRecipient(); + return false; Group* recipientGroup = recipient->GetGroup(); if (!recipientGroup) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bb06372c5a3..ba0f24bc05c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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 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); // durability lost message WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0); |
