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
Port From (https://github.com/TrinityCore/TrinityCore/commit/6d3be9cca62ec3149af490b8f6dbbd4f3127d531)
This commit is contained in:
@@ -768,14 +768,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Creature.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, Item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.DisenchantLootTemplate:
|
||||
@@ -785,14 +777,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Disenchant.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.FishingLootTemplate:
|
||||
@@ -802,14 +786,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Fishing.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.GameobjectLootTemplate:
|
||||
@@ -819,14 +795,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Gameobject.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.ItemLootTemplate:
|
||||
@@ -836,14 +804,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `item_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Items.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.MailLootTemplate:
|
||||
@@ -853,14 +813,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Mail.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.MillingLootTemplate:
|
||||
@@ -870,14 +822,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Milling.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.PickpocketingLootTemplate:
|
||||
@@ -887,14 +831,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Pickpocketing.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.ProspectingLootTemplate:
|
||||
@@ -904,14 +840,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Prospecting.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.ReferenceLootTemplate:
|
||||
@@ -921,14 +849,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Reference.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.SkinningLootTemplate:
|
||||
@@ -938,14 +858,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Skinning.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.SpellLootTemplate:
|
||||
@@ -955,14 +867,6 @@ namespace Game
|
||||
Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
LootTemplate loot = LootStorage.Spell.GetLootForConditionFill(cond.SourceGroup);
|
||||
ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry);
|
||||
if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.SpellImplicitTarget:
|
||||
|
||||
@@ -1064,15 +1064,6 @@ namespace Game.Loots
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsReference(uint id)
|
||||
{
|
||||
foreach (var storeItem in Entries)
|
||||
if (storeItem.itemid == id && storeItem.reference > 0)
|
||||
return true;
|
||||
|
||||
return false;//not found or not reference
|
||||
}
|
||||
|
||||
LootStoreItemList Entries = new(); // not grouped only
|
||||
Dictionary<int, LootGroup> Groups = new(); // groups have own (optimised) processing, grouped entries go there
|
||||
|
||||
|
||||
Reference in New Issue
Block a user