aboutsummaryrefslogtreecommitdiff
path: root/src/game/LootMgr.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-11 15:11:51 -0800
committermaximius <none@none>2009-11-11 15:11:51 -0800
commit389a377dd34ad9a423e1c5528c22975d1b06e6e6 (patch)
tree8d60db88158ba04be04a3735666b479cdbc60cd0 /src/game/LootMgr.cpp
parent2874864bc015e035dca2f369a7a681460018823c (diff)
*Destroy quest items on quest failure, and some cleanup.
--HG-- branch : trunk
Diffstat (limited to 'src/game/LootMgr.cpp')
-rw-r--r--src/game/LootMgr.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp
index aacc4cf56dd..f6c8bb6ac51 100644
--- a/src/game/LootMgr.cpp
+++ b/src/game/LootMgr.cpp
@@ -339,21 +339,21 @@ LootItem::LootItem(LootStoreItem const& li)
bool LootItem::AllowedForPlayer(Player const * player) const
{
// DB conditions check
- if ( !objmgr.IsPlayerMeetToCondition(player,conditionId) )
+ if (!objmgr.IsPlayerMeetToCondition(player,conditionId))
return false;
- if ( needs_quest )
+ if (needs_quest)
{
// Checking quests for quest-only drop (check only quests requirements in this case)
- if( !player->HasQuestForItem(itemid) )
+ if (!player->HasQuestForItem(itemid))
return false;
}
else
{
// Not quest only drop (check quest starting items for already accepted non-repeatable quests)
- ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid);
- if (pProto && pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid))
- return false;
+ if (ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid))
+ if (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid))
+ return false;
}
return true;
@@ -378,7 +378,7 @@ void Loot::AddItem(LootStoreItem const & item)
// non-conditional one-player only items are counted here,
// free for all items are counted in FillFFALoot(),
// non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot()
- if( !item.conditionId )
+ if (!item.conditionId)
{
ItemPrototype const* proto = objmgr.GetItemPrototype(item.itemid);
if (!proto || (proto->Flags & ITEM_FLAGS_PARTY_LOOT) == 0)
@@ -848,10 +848,10 @@ bool LootTemplate::LootGroup::HasQuestDrop() const
// True if group includes at least 1 quest drop entry for active quests of the player
bool LootTemplate::LootGroup::HasQuestDropForPlayer(Player const * player) const
{
- for (LootStoreItemList::const_iterator i=ExplicitlyChanced.begin(); i != ExplicitlyChanced.end(); ++i)
+ for (LootStoreItemList::const_iterator i = ExplicitlyChanced.begin(); i != ExplicitlyChanced.end(); ++i)
if (player->HasQuestForItem(i->itemid))
return true;
- for (LootStoreItemList::const_iterator i=EqualChanced.begin(); i != EqualChanced.end(); ++i)
+ for (LootStoreItemList::const_iterator i = EqualChanced.begin(); i != EqualChanced.end(); ++i)
if (player->HasQuestForItem(i->itemid))
return true;
return false;
@@ -1072,12 +1072,12 @@ bool LootTemplate::HasQuestDropForPlayer(LootTemplateMap const& store, Player co
if (Referenced->second->HasQuestDropForPlayer(store, player, i->group) )
return true;
}
- else if ( player->HasQuestForItem(i->itemid) )
+ else if (player->HasQuestForItem(i->itemid))
return true; // active quest drop found
}
// Now checking groups
- for (LootGroups::const_iterator i = Groups.begin(); i != Groups.end(); ++i )
+ for (LootGroups::const_iterator i = Groups.begin(); i != Groups.end(); ++i)
if (i->HasQuestDropForPlayer(player))
return true;