[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() { void Zone::GetMerchantDataForZoneLoad() {
LogInfo("Loading Merchant Lists"); LogInfo("Loading Merchant Lists");
auto query = fmt::format( auto query = fmt::format(
SQL ( SQL (
SELECT SELECT
DISTINCT merchantlist.merchantid, merchantid,
merchantlist.slot, slot,
merchantlist.item, item,
merchantlist.faction_required, faction_required,
merchantlist.level_required, level_required,
merchantlist.alt_currency_cost, alt_currency_cost,
merchantlist.classes_required, classes_required,
merchantlist.probability, probability,
merchantlist.bucket_name, bucket_name,
merchantlist.bucket_value, bucket_value,
merchantlist.bucket_comparison bucket_comparison
FROM from merchantlist where merchantid IN (
merchantlist, select merchant_id from npc_types where id in (
npc_types, select npcID from spawnentry where spawngroupID IN (
spawnentry, select spawngroupID from spawn2 where `zone` = '{}' and (`version` = {} OR `version` = -1)
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 = {}
{}
ORDER BY ORDER BY
merchantlist.slot merchantlist.slot
), ),
GetShortName(), GetShortName(),
GetInstanceVersion(), GetInstanceVersion(),
ContentFilterCriteria::apply("merchantlist") ContentFilterCriteria::apply()
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);

View File

@ -2356,7 +2356,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
SQL( SQL(
id IN ( id IN (
select npcID from spawnentry where spawngroupID 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)
) )
) )
), ),