mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 02:11:30 +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)
|
||||
{
|
||||
const auto& recipe_entries = TradeskillRecipeEntriesRepository::GetWhere(
|
||||
auto recipe_entries = TradeskillRecipeEntriesRepository::GetWhere(
|
||||
content_db,
|
||||
fmt::format(
|
||||
"recipe_id = {} ORDER BY id ASC",
|
||||
"recipe_id = {} ORDER BY componentcount DESC",
|
||||
recipe_id
|
||||
)
|
||||
);
|
||||
@ -1876,21 +1876,28 @@ bool Client::CheckTradeskillLoreConflict(int32 recipe_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto& e : recipe_entries) {
|
||||
auto item_inst = database.GetItem(e.item_id);
|
||||
if (item_inst) {
|
||||
if (item_inst->LoreGroup == 0 || e.componentcount > 0 || e.iscontainer) {
|
||||
continue;
|
||||
for (auto& f : recipe_entries) {
|
||||
for (auto &e: recipe_entries) {
|
||||
if (f.componentcount > 0 && e.item_id == f.item_id && e.componentcount == 0) {
|
||||
e.item_id = 0;
|
||||
}
|
||||
if (CheckLoreConflict(item_inst)) {
|
||||
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;
|
||||
auto item_inst = database.GetItem(e.item_id);
|
||||
if (item_inst) {
|
||||
if (item_inst->LoreGroup >= 0 || e.componentcount > 0 || e.iscontainer) {
|
||||
continue;
|
||||
}
|
||||
if (CheckLoreConflict(item_inst)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user