Core/Spells: Stop exploit that allowed looting despawned gameobjects by packet manipulation.

This commit is contained in:
leak
2011-01-18 20:02:28 +01:00
parent e05ab4b25a
commit 40af92dd66
+7
View File
@@ -2704,6 +2704,13 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
if (gameObjTarget)
{
// Players shouldn't be able to loot gameobjects that are currently despawned
if (gameObjTarget->GetRespawnTime() > 0 && !player->isGameMaster())
{
sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!",
player->GetName(), player->GetGUIDLow(), gameObjTarget->GetEntry(), gameObjTarget->GetGUIDLow());
return;
}
// special case, already has GossipHello inside so return and avoid calling twice
if (gameObjTarget->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
{