diff options
author | Spp <spp@jorge.gr> | 2012-02-27 14:58:47 +0100 |
---|---|---|
committer | Spp <spp@jorge.gr> | 2012-02-27 14:58:47 +0100 |
commit | d38bc3a17857c36a3ab871deac57b314987194bb (patch) | |
tree | e5c88ec17e7741db46eb6f6de6148ce039a1918b /src/server/game/Handlers/LootHandler.cpp | |
parent | 3e622ee7ac36de3a1e137c12b03417c3880ba342 (diff) |
Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there
Diffstat (limited to 'src/server/game/Handlers/LootHandler.cpp')
-rwxr-xr-x | src/server/game/Handlers/LootHandler.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 6508f08dc22..496eae34133 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -386,8 +386,8 @@ void WorldSession::DoLootRelease(uint64 lguid) { Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid); - bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); - if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) + bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); + if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) return; loot = &creature->loot; @@ -448,7 +448,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (_player->GetLootGUID() != lootguid) return; - Loot* pLoot = NULL; + Loot* loot = NULL; if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID())) { @@ -456,7 +456,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (!creature) return; - pLoot = &creature->loot; + loot = &creature->loot; } else if (IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID())) { @@ -464,19 +464,19 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (!pGO) return; - pLoot = &pGO->loot; + loot = &pGO->loot; } - if (!pLoot) + if (!loot) return; - if (slotid > pLoot->items.size()) + if (slotid > loot->items.size()) { - sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); + sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)loot->items.size()); return; } - LootItem& item = pLoot->items[slotid]; + LootItem& item = loot->items[slotid]; ItemPosCountVec dest; InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count); @@ -495,14 +495,13 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters); target->SendNewItem(newitem, uint32(item.count), false, false, true); target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count); - target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, pLoot->loot_type, item.count); + target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count); target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count); // mark as looted item.count=0; item.is_looted=true; - pLoot->NotifyItemRemoved(slotid); - --pLoot->unlootedCount; + loot->NotifyItemRemoved(slotid); + --loot->unlootedCount; } - |