aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-12-31 20:50:39 +0100
committerShauren <shauren.trinity@gmail.com>2016-12-31 20:50:39 +0100
commitdc704efe451997b2cbec69bfc0e8f62055f78c74 (patch)
tree6e772084d8f36d13f0a30206e4a1aa318fa2c4d4 /src/server/game/Entities
parentca306c6019909df5e8a736b5f29141d8499d58b3 (diff)
Core/Loot: Increased allowed loot range and updated SendLootError
Closes #18685
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Player/Player.cpp17
-rw-r--r--src/server/game/Entities/Player/Player.h2
2 files changed, 10 insertions, 9 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 9db69e2e627..d89efc1abad 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -8308,7 +8308,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, bool aeLooting/* = fa
}
else
{
- SendLootError(guid, LOOT_ERROR_ALREADY_PICKPOCKETED);
+ SendLootError(loot->GetGUID(), guid, LOOT_ERROR_ALREADY_PICKPOCKETED);
return;
}
} // else - still has pickpocket loot generated & not fully taken
@@ -8429,19 +8429,20 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, bool aeLooting/* = fa
m_AELootView[loot->GetGUID()] = guid;
}
else
- SendLootError(GetLootGUID(), LOOT_ERROR_DIDNT_KILL);
+ SendLootError(loot->GetGUID(), guid, LOOT_ERROR_DIDNT_KILL);
if (loot_type == LOOT_CORPSE && !guid.IsItem())
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_LOOTING);
}
-void Player::SendLootError(ObjectGuid guid, LootError error) const
+void Player::SendLootError(ObjectGuid const& lootObj, ObjectGuid const& owner, LootError error) const
{
- WorldPacket data(SMSG_LOOT_RESPONSE, 10);
- data << guid;
- data << uint8(LOOT_NONE);
- data << uint8(error);
- SendDirectMessage(&data);
+ WorldPackets::Loot::LootResponse lootResponse;
+ lootResponse.LootObj = lootObj;
+ lootResponse.Owner = GetLootWorldObjectGUID(lootObj);
+ lootResponse.Acquired = false;
+ lootResponse.FailureReason = error;
+ SendDirectMessage(lootResponse.Write());
}
void Player::SendNotifyLootMoneyRemoved(ObjectGuid lootObj) const
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index c4f229de191..a1eefe4e40e 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -2198,7 +2198,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
std::vector<ItemSetEffect*> ItemSetEff;
void SendLoot(ObjectGuid guid, LootType loot_type, bool aeLooting = false);
- void SendLootError(ObjectGuid guid, LootError error) const;
+ void SendLootError(ObjectGuid const& lootObj, ObjectGuid const& owner, LootError error) const;
void SendLootRelease(ObjectGuid guid) const;
void SendLootReleaseAll() const;
void SendNotifyLootItemRemoved(ObjectGuid lootObj, uint8 lootSlot) const;