mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Conditions: Remove unneccessary duplicate condition startup checks - item existance is checked by loot loading and if that fails, condition loading will fail to find related item inside loot
This commit is contained in:
@@ -1710,14 +1710,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Creature.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE:
|
||||
@@ -1727,14 +1719,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Disenchant.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE:
|
||||
@@ -1744,14 +1728,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Fishing.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE:
|
||||
@@ -1761,14 +1737,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Gameobject.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE:
|
||||
@@ -1778,14 +1746,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Item.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE:
|
||||
@@ -1795,14 +1755,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Mail.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE:
|
||||
@@ -1812,14 +1764,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Milling.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE:
|
||||
@@ -1829,14 +1773,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Pickpocketing.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE:
|
||||
@@ -1846,14 +1782,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Prospecting.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE:
|
||||
@@ -1863,14 +1791,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Reference.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE:
|
||||
@@ -1880,14 +1800,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Skinning.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE:
|
||||
@@ -1897,14 +1809,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceGroup in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate* loot = LootTemplates_Spell.GetLootForConditionFill(cond->SourceGroup);
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto && !loot->isReference(cond->SourceEntry))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "{} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond->ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET:
|
||||
|
||||
@@ -863,15 +863,6 @@ bool LootTemplate::LinkConditions(ConditionId const& id, ConditionsReference ref
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LootTemplate::isReference(uint32 id)
|
||||
{
|
||||
for (LootStoreItemList::const_iterator ieItr = Entries.begin(); ieItr != Entries.end(); ++ieItr)
|
||||
if ((*ieItr)->itemid == id && (*ieItr)->reference > 0)
|
||||
return true;
|
||||
|
||||
return false;//not found or not reference
|
||||
}
|
||||
|
||||
std::unordered_map<ObjectGuid, std::unique_ptr<Loot>> GenerateDungeonEncounterPersonalLoot(uint32 dungeonEncounterId, uint32 lootId, LootStore const& store,
|
||||
LootType type, WorldObject const* lootOwner, uint32 minMoney, uint32 maxMoney, uint16 lootMode, MapDifficultyEntry const* mapDifficulty,
|
||||
std::vector<Player*> const& tappers)
|
||||
|
||||
@@ -137,7 +137,6 @@ class TC_GAME_API LootTemplate
|
||||
void Verify(LootStore const& store, uint32 Id) const;
|
||||
void CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_set) const;
|
||||
bool LinkConditions(ConditionId const& id, ConditionsReference reference);
|
||||
bool isReference(uint32 id);
|
||||
|
||||
private:
|
||||
LootStoreItemList Entries; // not grouped only
|
||||
|
||||
Reference in New Issue
Block a user