aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlinencloth <none@none>2010-09-15 17:44:56 +0200
committerlinencloth <none@none>2010-09-15 17:44:56 +0200
commit9739bea487bf9e5791379db51b56f58016fb2386 (patch)
tree9c484a708ec006c79a79f3e78aae8f66d1f6aa14 /src
parent52bc2478c98bc914d0aa450bab81a873acfd79d4 (diff)
Core/Loot: Reimplement the proper check for loot recipient to prevent rewarding loot without tagging the creature by the player.
Also fix the related skinning problem, and do not set the skinnable flag for creatures without any loot recipient. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp3
-rw-r--r--src/server/game/Entities/Player/Player.cpp5
-rw-r--r--src/server/game/Server/Protocol/Handlers/LootHandler.cpp1
3 files changed, 3 insertions, 6 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index a2778f1cc25..95bff2e4fdc 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1494,7 +1494,8 @@ void Creature::setDeathState(DeathState s)
if (!isPet() && GetCreatureInfo()->SkinLootId)
if (LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId))
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
+ if (hasLootRecipient())
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
if (HasSearchedAssistance())
{
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 462ac0d97c5..1d306c13d0c 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -8464,10 +8464,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
// the player whose group may loot the corpse
Player *recipient = creature->GetLootRecipient();
if (!recipient)
- {
- creature->SetLootRecipient(this);
- recipient = this;
- }
+ return;
if (!creature->lootForBody)
{
diff --git a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp
index ca4af9fee27..1baaa8faa84 100644
--- a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp
@@ -383,7 +383,6 @@ void WorldSession::DoLootRelease(uint64 lguid)
pCreature->AllLootRemovedFromCorpse();
pCreature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- pCreature->SetLootRecipient(NULL);
loot->clear();
}
else