[Loading] Zone Version Loading Fixes (#2233)

* Zone version loading fixes

* Remove errant code
This commit is contained in:
Chris Miles 2022-05-31 22:15:05 -05:00 committed by GitHub
parent a45117cd04
commit 59f32b8d34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 26 deletions

View File

@ -655,38 +655,35 @@ void Zone::LoadNewMerchantData(uint32 merchantid) {
void Zone::GetMerchantDataForZoneLoad() {
LogInfo("Loading Merchant Lists");
auto query = fmt::format(
SQL (
SELECT
DISTINCT merchantlist.merchantid,
merchantlist.slot,
merchantlist.item,
merchantlist.faction_required,
merchantlist.level_required,
merchantlist.alt_currency_cost,
merchantlist.classes_required,
merchantlist.probability,
merchantlist.bucket_name,
merchantlist.bucket_value,
merchantlist.bucket_comparison
FROM
merchantlist,
npc_types,
spawnentry,
spawn2
WHERE
npc_types.merchant_id = merchantlist.merchantid
AND npc_types.id = spawnentry.npcid
AND spawnentry.spawngroupid = spawn2.spawngroupid
AND spawn2.zone = '{}'
AND spawn2.version = {}
{}
merchantid,
slot,
item,
faction_required,
level_required,
alt_currency_cost,
classes_required,
probability,
bucket_name,
bucket_value,
bucket_comparison
from merchantlist where merchantid IN (
select merchant_id from npc_types where id in (
select npcID from spawnentry where spawngroupID IN (
select spawngroupID from spawn2 where `zone` = '{}' and (`version` = {} OR `version` = -1)
)
)
)
{}
ORDER BY
merchantlist.slot
merchantlist.slot
),
GetShortName(),
GetInstanceVersion(),
ContentFilterCriteria::apply("merchantlist")
ContentFilterCriteria::apply()
);
auto results = content_db.QueryDatabase(query);

View File

@ -2356,7 +2356,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
SQL(
id IN (
select npcID from spawnentry where spawngroupID IN (
select spawngroupID from spawn2 where `zone` = '{}' and `version` = {}
select spawngroupID from spawn2 where `zone` = '{}' and (`version` = {} OR `version` = -1)
)
)
),