*Minor cleanup.

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-28 17:50:33 -07:00
parent cfd98ebe1e
commit 98e546a804
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -241,7 +241,7 @@ void LootStore::ReportNotExistedId(uint32 id) const
// RATE_DROP_ITEMS is no longer used for all types of entries // RATE_DROP_ITEMS is no longer used for all types of entries
bool LootStoreItem::Roll(bool rate) const bool LootStoreItem::Roll(bool rate) const
{ {
if(chance>=100.0f) if(chance >= 100.0f)
return true; return true;
if(mincountOrRef < 0) // reference case if(mincountOrRef < 0) // reference case
@@ -269,7 +269,7 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
return false; return false;
} }
if( mincountOrRef > 0 ) // item (quest or non-quest) entry, maybe grouped if (mincountOrRef > 0) // item (quest or non-quest) entry, maybe grouped
{ {
ItemPrototype const *proto = objmgr.GetItemPrototype(itemid); ItemPrototype const *proto = objmgr.GetItemPrototype(itemid);
if(!proto) if(!proto)
@@ -391,7 +391,7 @@ void Loot::AddItem(LootStoreItem const & item)
void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, uint16 lootMode /*= DEFAULT_LOOT_MODE*/) void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, uint16 lootMode /*= DEFAULT_LOOT_MODE*/)
{ {
// Must be provided // Must be provided
if(!loot_owner) if (!loot_owner)
return; return;
LootTemplate const* tab = store.GetLootFor(loot_id); LootTemplate const* tab = store.GetLootFor(loot_id);
@@ -408,7 +408,7 @@ void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner,
tab->Process(*this, store, store.IsRatesAllowed(), lootMode); // Processing is done there, callback via Loot::AddItem() tab->Process(*this, store, store.IsRatesAllowed(), lootMode); // Processing is done there, callback via Loot::AddItem()
// Setting access rights for group loot case // Setting access rights for group loot case
Group * pGroup=loot_owner->GetGroup(); Group * pGroup = loot_owner->GetGroup();
if(!personal && pGroup) if(!personal && pGroup)
{ {
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+2 -2
View File
@@ -80,8 +80,8 @@ struct LootStoreItem
uint32 itemid; // id of the item uint32 itemid; // id of the item
float chance; // always positive, chance to drop for both quest and non-quest items, chance to be used for refs float chance; // always positive, chance to drop for both quest and non-quest items, chance to be used for refs
int32 mincountOrRef; // mincount for drop items (positive) or minus referenced TemplateleId (negative) int32 mincountOrRef; // mincount for drop items (positive) or minus referenced TemplateleId (negative)
uint8 group :7;
uint16 lootmode; uint16 lootmode;
uint8 group :7;
bool needs_quest :1; // quest drop (negative ChanceOrQuestChance in DB) bool needs_quest :1; // quest drop (negative ChanceOrQuestChance in DB)
uint8 maxcount :8; // max drop count for the item (mincountOrRef positive) or Ref multiplicator (mincountOrRef negative) uint8 maxcount :8; // max drop count for the item (mincountOrRef positive) or Ref multiplicator (mincountOrRef negative)
uint16 conditionId :16; // additional loot condition Id uint16 conditionId :16; // additional loot condition Id
@@ -187,7 +187,7 @@ class LootTemplate
void Process(Loot& loot, LootStore const& store, bool rate, uint16 lootMode, uint8 groupId = 0) const; void Process(Loot& loot, LootStore const& store, bool rate, uint16 lootMode, uint8 groupId = 0) const;
// True if template includes at least 1 quest drop entry // True if template includes at least 1 quest drop entry
bool HasQuestDrop(LootTemplateMap const& store, uint8 GroupId = 0) const; bool HasQuestDrop(LootTemplateMap const& store, uint8 groupId = 0) const;
// True if template includes at least 1 quest drop for an active quest of the player // True if template includes at least 1 quest drop for an active quest of the player
bool HasQuestDropForPlayer(LootTemplateMap const& store, Player const * player, uint8 groupId = 0) const; bool HasQuestDropForPlayer(LootTemplateMap const& store, Player const * player, uint8 groupId = 0) const;