mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 12:31:31 +00:00
[Bug Fix] Account for bad data in Tradeskill Recipe Entries (#2991)
This commit is contained in:
parent
5f68e4a41a
commit
6179b7481e
@ -1865,10 +1865,10 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id)
|
|||||||
|
|
||||||
bool Client::CheckTradeskillLoreConflict(int32 recipe_id)
|
bool Client::CheckTradeskillLoreConflict(int32 recipe_id)
|
||||||
{
|
{
|
||||||
const auto& recipe_entries = TradeskillRecipeEntriesRepository::GetWhere(
|
auto recipe_entries = TradeskillRecipeEntriesRepository::GetWhere(
|
||||||
content_db,
|
content_db,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"recipe_id = {} ORDER BY id ASC",
|
"recipe_id = {} ORDER BY componentcount DESC",
|
||||||
recipe_id
|
recipe_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -1876,21 +1876,28 @@ bool Client::CheckTradeskillLoreConflict(int32 recipe_id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& e : recipe_entries) {
|
for (auto& f : recipe_entries) {
|
||||||
auto item_inst = database.GetItem(e.item_id);
|
for (auto &e: recipe_entries) {
|
||||||
if (item_inst) {
|
if (f.componentcount > 0 && e.item_id == f.item_id && e.componentcount == 0) {
|
||||||
if (item_inst->LoreGroup == 0 || e.componentcount > 0 || e.iscontainer) {
|
e.item_id = 0;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (CheckLoreConflict(item_inst)) {
|
auto item_inst = database.GetItem(e.item_id);
|
||||||
EQ::SayLinkEngine linker;
|
if (item_inst) {
|
||||||
linker.SetLinkType(EQ::saylink::SayLinkItemData);
|
if (item_inst->LoreGroup >= 0 || e.componentcount > 0 || e.iscontainer) {
|
||||||
linker.SetItemData(item_inst);
|
continue;
|
||||||
auto item_link = linker.GenerateLink();
|
}
|
||||||
MessageString(Chat::Red, TRADESKILL_COMBINE_LORE, item_link.c_str());
|
if (CheckLoreConflict(item_inst)) {
|
||||||
return true;
|
EQ::SayLinkEngine linker;
|
||||||
|
linker.SetLinkType(EQ::saylink::SayLinkItemData);
|
||||||
|
linker.SetItemData(item_inst);
|
||||||
|
auto item_link = linker.GenerateLink();
|
||||||
|
MessageString(Chat::Red, TRADESKILL_COMBINE_LORE, item_link.c_str());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user