Skip to content

Commit

Permalink
Core/Loot: couple of small changes to loot.
Browse files Browse the repository at this point in the history
  • Loading branch information
Star-lion committed Jul 9, 2012
1 parent 8f6d8c3 commit d583642
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/server/game/Loot/LootMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,19 +514,18 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
{
LootItem &item = quest_items[i];

if ((!item.is_looted && item.AllowedForPlayer(player)) || (item.follow_loot_rules && player->GetGroup() && player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetLooterGuid() == player->GetGUID()))
if (!item.is_looted && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && (player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT )))
{
ql->push_back(QuestItem(i));

// quest items get blocked when they first appear in a
// player's quest vector
//
// increase once if one looter only, looter-times if free for all
if (item.freeforall && !item.is_blocked)
{
if (item.freeforall || !item.is_blocked)
++unlootedCount;
if (!player->GetGroup() || (player->GetGroup()->GetLootMethod() != GROUP_LOOT || player->GetGroup()->GetLootMethod() != ROUND_ROBIN))
item.is_blocked = true;
}

if (items.size() + ql->size() == MAX_NR_LOOT_ITEMS)
break;
Expand All @@ -549,7 +548,7 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool pres
for (uint8 i = 0; i < items.size(); ++i)
{
LootItem &item = items[i];
if (!item.is_looted && !item.freeforall && (item.AllowedForPlayer(player)) || (item.follow_loot_rules && player->GetGroup() && player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetLooterGuid() == player->GetGUID()))
if (!item.is_looted && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && (player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT )))
{
if (presentAtLooting)
item.AddAllowedLooter(player);
Expand Down Expand Up @@ -892,7 +891,6 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
}

LootSlotType slotType = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT;
LootSlotType partySlotType = lv.permission == MASTER_PERMISSION ? LOOT_SLOT_TYPE_MASTER : (lv.permission == GROUP_PERMISSION ? LOOT_SLOT_TYPE_ROLL_ONGOING : slotType);
QuestItemMap const& lootPlayerQuestItems = l.GetPlayerQuestItems();
QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUIDLow());
if (q_itr != lootPlayerQuestItems.end())
Expand All @@ -913,8 +911,12 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
b << uint8(LOOT_SLOT_TYPE_MASTER);
break;
case GROUP_PERMISSION:
case ROUND_ROBIN_PERMISSION:
if (!item.is_blocked)
{
b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
item.is_blocked == true;
}
else
b << uint8(LOOT_SLOT_TYPE_ROLL_ONGOING);
break;
Expand Down Expand Up @@ -968,8 +970,12 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
b << uint8(LOOT_SLOT_TYPE_MASTER);
break;
case GROUP_PERMISSION:
case ROUND_ROBIN_PERMISSION:
if (!item.is_blocked)
{
b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
item.is_blocked == true;

This comment has been minimized.

Copy link
@FilipLukac

FilipLukac Jul 9, 2012

not items.is_blocked = true ?:P == operator is compare operator

}
else
b << uint8(LOOT_SLOT_TYPE_ROLL_ONGOING);
break;
Expand Down

0 comments on commit d583642

Please sign in to comment.