*Should fix the reversed groupid-lootmode issue.

*Cleanup, and convert npc_innkeeper.cpp back to ANSI from UTF-8 (was causing *nix compile issues apparently)

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-28 18:25:36 -07:00
parent 98e546a804
commit d2b869d4e2
4 changed files with 27 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -83,7 +83,7 @@ void LootStore::Clear()
// Actual checks are done within LootTemplate::Verify() which is called for every template
void LootStore::Verify() const
{
for (LootTemplateMap::const_iterator i = m_LootTemplates.begin(); i != m_LootTemplates.end(); ++i )
for (LootTemplateMap::const_iterator i = m_LootTemplates.begin(); i != m_LootTemplates.end(); ++i)
i->second->Verify(*this, i->first);
}
@@ -1063,9 +1063,9 @@ void LootTemplate::CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_se
{
for (LootStoreItemList::const_iterator ieItr = Entries.begin(); ieItr != Entries.end(); ++ieItr)
{
if(ieItr->mincountOrRef < 0)
if (ieItr->mincountOrRef < 0)
{
if(!LootTemplates_Reference.GetLootFor(-ieItr->mincountOrRef))
if (!LootTemplates_Reference.GetLootFor(-ieItr->mincountOrRef))
LootTemplates_Reference.ReportNotExistedId(-ieItr->mincountOrRef);
else if(ref_set)
ref_set->erase(-ieItr->mincountOrRef);
@@ -1082,7 +1082,7 @@ void LoadLootTemplates_Creature()
LootTemplates_Creature.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i )
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
{
if(CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
@@ -1108,13 +1108,13 @@ void LoadLootTemplates_Disenchant()
LootTemplates_Disenchant.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
{
if(ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i))
if (ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i))
{
if(uint32 lootid = proto->DisenchantID)
if (uint32 lootid = proto->DisenchantID)
{
if(!ids_set.count(lootid))
if (!ids_set.count(lootid))
LootTemplates_Disenchant.ReportNotExistedId(lootid);
else
ids_setUsed.insert(lootid);
@@ -1133,12 +1133,10 @@ void LoadLootTemplates_Fishing()
LootTemplates_Fishing.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
for (uint32 i = 1; i < sAreaStore.GetNumRows(); ++i )
{
if(AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(i))
if(ids_set.count(areaEntry->ID))
for (uint32 i = 1; i < sAreaStore.GetNumRows(); ++i)
if (AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(i))
if (ids_set.count(areaEntry->ID))
ids_set.erase(areaEntry->ID);
}
// output error for any still listed (not referenced from appropriate table) ids
LootTemplates_Fishing.ReportUnusedIds(ids_set);
@@ -1152,11 +1150,11 @@ void LoadLootTemplates_Gameobject()
// remove real entries and check existence loot
for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i )
{
if(GameObjectInfo const* gInfo = sGOStorage.LookupEntry<GameObjectInfo>(i))
if (GameObjectInfo const* gInfo = sGOStorage.LookupEntry<GameObjectInfo>(i))
{
if(uint32 lootid = gInfo->GetLootId())
if (uint32 lootid = gInfo->GetLootId())
{
if(!ids_set.count(lootid))
if (!ids_set.count(lootid))
LootTemplates_Gameobject.ReportNotExistedId(lootid);
else
ids_setUsed.insert(lootid);
@@ -1243,13 +1241,13 @@ void LoadLootTemplates_Prospecting()
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
{
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i);
if(!proto)
if (!proto)
continue;
if((proto->BagFamily & BAG_FAMILY_MASK_MINING_SUPP)==0)
if ((proto->BagFamily & BAG_FAMILY_MASK_MINING_SUPP)==0)
continue;
if(ids_set.count(proto->ItemId))
if (ids_set.count(proto->ItemId))
ids_set.erase(proto->ItemId);
}
@@ -1264,12 +1262,12 @@ void LoadLootTemplates_QuestMail()
// remove real entries and check existence loot
ObjectMgr::QuestMap const& questMap = objmgr.GetQuestTemplates();
for (ObjectMgr::QuestMap::const_iterator itr = questMap.begin(); itr != questMap.end(); ++itr )
for (ObjectMgr::QuestMap::const_iterator itr = questMap.begin(); itr != questMap.end(); ++itr)
{
if(!itr->second->GetRewMailTemplateId())
if (!itr->second->GetRewMailTemplateId())
continue;
if(ids_set.count(itr->first))
if (ids_set.count(itr->first))
ids_set.erase(itr->first);
/* disabled reporting: some quest mails not include items
else
@@ -1287,13 +1285,13 @@ void LoadLootTemplates_Skinning()
LootTemplates_Skinning.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i )
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
{
if(CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
if(uint32 lootid = cInfo->SkinLootId)
if (uint32 lootid = cInfo->SkinLootId)
{
if(!ids_set.count(lootid))
if (!ids_set.count(lootid))
LootTemplates_Skinning.ReportNotExistedId(lootid);
else
ids_setUsed.insert(lootid);

View File

@@ -88,7 +88,7 @@ struct LootStoreItem
// Constructor, converting ChanceOrQuestChance -> (chance, needs_quest)
// displayid is filled in IsValid() which must be called after
LootStoreItem(uint32 _itemid, float _chanceOrQuestChance, uint8 _group, uint16 _lootmode, uint8 _conditionId, int32 _mincountOrRef, uint8 _maxcount)
LootStoreItem(uint32 _itemid, float _chanceOrQuestChance, uint16 _lootmode, uint8 _group, uint8 _conditionId, int32 _mincountOrRef, uint8 _maxcount)
: itemid(_itemid), chance(fabs(_chanceOrQuestChance)), mincountOrRef(_mincountOrRef), lootmode(_lootmode),
group(_group), needs_quest(_chanceOrQuestChance < 0), maxcount(_maxcount), conditionId(_conditionId)
{}

View File

@@ -58,7 +58,7 @@ class PoolGroup
typedef std::vector<PoolObject> PoolObjectList;
PoolObjectList ExplicitlyChanced;
PoolObjectList EqualChanced;
uint32 m_LastDespawnedNode ; // Store the guid of the removed creature/gameobject during a pool update
uint32 m_LastDespawnedNode; // Store the guid of the removed creature/gameobject during a pool update
uint32 m_SpawnedPoolAmount; // Used to know the number of spawned objects
};