mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-18 19:41: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)
|
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,10 +1876,14 @@ bool Client::CheckTradeskillLoreConflict(int32 recipe_id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& e : recipe_entries) {
|
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;
|
||||||
|
}
|
||||||
auto item_inst = database.GetItem(e.item_id);
|
auto item_inst = database.GetItem(e.item_id);
|
||||||
if (item_inst) {
|
if (item_inst) {
|
||||||
if (item_inst->LoreGroup == 0 || e.componentcount > 0 || e.iscontainer) {
|
if (item_inst->LoreGroup >= 0 || e.componentcount > 0 || e.iscontainer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (CheckLoreConflict(item_inst)) {
|
if (CheckLoreConflict(item_inst)) {
|
||||||
@ -1892,5 +1896,8 @@ bool Client::CheckTradeskillLoreConflict(int32 recipe_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user