mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Fix] Bazaar Search window not working in a DZ (#4828)
This commit is contained in:
parent
b813cf71bb
commit
216b3a039f
@ -54,17 +54,31 @@ public:
|
|||||||
{
|
{
|
||||||
BulkTraders_Struct all_entries{};
|
BulkTraders_Struct all_entries{};
|
||||||
std::vector<DistinctTraders_Struct> distinct_traders;
|
std::vector<DistinctTraders_Struct> distinct_traders;
|
||||||
|
MySQLRequestResult results;
|
||||||
|
|
||||||
auto results = db.QueryDatabase(fmt::format(
|
if (RuleB(Bazaar, UseAlternateBazaarSearch)) {
|
||||||
"SELECT DISTINCT(t.char_id), t.char_zone_id, t.char_zone_instance_id, t.char_entity_id, c.name "
|
results = db.QueryDatabase(fmt::format(
|
||||||
"FROM trader AS t "
|
"SELECT DISTINCT(t.char_id), t.char_zone_id, t.char_zone_instance_id, t.char_entity_id, c.name "
|
||||||
"JOIN character_data AS c ON t.char_id = c.id "
|
"FROM trader AS t "
|
||||||
"WHERE t.char_zone_instance_id = {} "
|
"JOIN character_data AS c ON t.char_id = c.id "
|
||||||
"ORDER BY t.char_zone_instance_id ASC "
|
"WHERE t.char_zone_instance_id = {} "
|
||||||
"LIMIT {}",
|
"ORDER BY t.char_zone_instance_id ASC "
|
||||||
char_zone_instance_id,
|
"LIMIT {}",
|
||||||
max_results)
|
char_zone_instance_id,
|
||||||
);
|
max_results)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
results = db.QueryDatabase(fmt::format(
|
||||||
|
"SELECT DISTINCT(t.char_id), t.char_zone_id, t.char_zone_instance_id, t.char_entity_id, c.name "
|
||||||
|
"FROM trader AS t "
|
||||||
|
"JOIN character_data AS c ON t.char_id = c.id "
|
||||||
|
"ORDER BY t.char_zone_instance_id ASC "
|
||||||
|
"LIMIT {}",
|
||||||
|
char_zone_instance_id,
|
||||||
|
max_results)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
distinct_traders.reserve(results.RowCount());
|
distinct_traders.reserve(results.RowCount());
|
||||||
|
|
||||||
|
|||||||
@ -2739,8 +2739,6 @@ void Client::SendBulkBazaarTraders()
|
|||||||
|
|
||||||
SetTraderCount(results.count);
|
SetTraderCount(results.count);
|
||||||
|
|
||||||
SetTraderCount(results.count);
|
|
||||||
|
|
||||||
auto p_size = 4 + 12 * results.count + results.name_length;
|
auto p_size = 4 + 12 * results.count + results.name_length;
|
||||||
auto buffer = std::make_unique<char[]>(p_size);
|
auto buffer = std::make_unique<char[]>(p_size);
|
||||||
memset(buffer.get(), 0, p_size);
|
memset(buffer.get(), 0, p_size);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user