mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8779] Not output error at empty item loot for mail template at mail creating.
This commit is contained in:
parent
a6d245058d
commit
d594a29af1
6 changed files with 20 additions and 18 deletions
|
|
@ -488,10 +488,8 @@ void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner)
|
|||
GetZoneAndAreaId(zone,subzone);
|
||||
|
||||
// if subzone loot exist use it
|
||||
if(LootTemplates_Fishing.HaveLootFor(subzone))
|
||||
fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner,true);
|
||||
// else use zone loot
|
||||
else
|
||||
if (!fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner, true, true))
|
||||
// else use zone loot (must exist in like case)
|
||||
fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner,true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -386,18 +386,19 @@ void Loot::AddItem(LootStoreItem const & item)
|
|||
}
|
||||
|
||||
// Calls processor of corresponding LootTemplate (which handles everything including references)
|
||||
void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal)
|
||||
bool Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, bool noEmptyError)
|
||||
{
|
||||
// Must be provided
|
||||
if(!loot_owner)
|
||||
return;
|
||||
return false;
|
||||
|
||||
LootTemplate const* tab = store.GetLootFor(loot_id);
|
||||
|
||||
if (!tab)
|
||||
{
|
||||
if (!noEmptyError)
|
||||
sLog.outErrorDb("Table '%s' loot id #%u used but it doesn't have records.",store.GetName(),loot_id);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
items.reserve(MAX_NR_LOOT_ITEMS);
|
||||
|
|
@ -416,6 +417,8 @@ void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner,
|
|||
// ... for personal loot
|
||||
else
|
||||
FillNotNormalLootFor(loot_owner);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Loot::FillNotNormalLootFor(Player* pl)
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ struct Loot
|
|||
void RemoveLooter(uint64 GUID) { PlayersLooting.erase(GUID); }
|
||||
|
||||
void generateMoneyLoot(uint32 minAmount, uint32 maxAmount);
|
||||
void FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal);
|
||||
bool FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, bool noEmptyError = false);
|
||||
|
||||
// Inserts the item into the loot (called by LootTemplate processors)
|
||||
void AddItem(LootStoreItem const & item);
|
||||
|
|
|
|||
|
|
@ -837,7 +837,8 @@ void MailDraft::prepareItems(Player* receiver)
|
|||
|
||||
Loot mailLoot;
|
||||
|
||||
mailLoot.FillLoot(m_mailTemplateId, LootTemplates_Mail, receiver,true);
|
||||
// can be empty
|
||||
mailLoot.FillLoot(m_mailTemplateId, LootTemplates_Mail, receiver, true, true);
|
||||
|
||||
uint32 max_slot = mailLoot.GetMaxSlotInLootFor(receiver);
|
||||
for(uint32 i = 0; m_items.size() < MAX_MAIL_ITEMS && i < max_slot; ++i)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8778"
|
||||
#define REVISION_NR "8779"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue