From d5911e1c927242dd0ee7cacb15e8e0fc3ebf02f0 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 14 Nov 2021 16:48:38 -0500 Subject: [PATCH] Misc fixes. --- Source/Game/Combat/ThreatManager.cs | 2 +- Source/Game/DataStorage/CliDB.cs | 24 +++++++++---------- .../Networking/Packets/ClientConfigPackets.cs | 2 +- Source/Game/Networking/Packets/MiscPackets.cs | 2 +- Source/Game/Server/WorldSession.cs | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Source/Game/Combat/ThreatManager.cs b/Source/Game/Combat/ThreatManager.cs index b24034e08..070330e75 100644 --- a/Source/Game/Combat/ThreatManager.cs +++ b/Source/Game/Combat/ThreatManager.cs @@ -96,7 +96,7 @@ namespace Game.Combat public Unit GetCurrentVictim() { - if (_currentVictimRef != null || _currentVictimRef.ShouldBeOffline()) + if (_currentVictimRef == null || _currentVictimRef.ShouldBeOffline()) UpdateVictim(); if (_currentVictimRef != null && !_currentVictimRef.ShouldBeOffline()) diff --git a/Source/Game/DataStorage/CliDB.cs b/Source/Game/DataStorage/CliDB.cs index 3ef3cd502..f0a8725b9 100644 --- a/Source/Game/DataStorage/CliDB.cs +++ b/Source/Game/DataStorage/CliDB.cs @@ -80,10 +80,10 @@ namespace Game.DataStorage AzeriteKnowledgeMultiplierStorage = ReadDB2("AzeriteKnowledgeMultiplier.db2", HotfixStatements.SEL_AZERITE_KNOWLEDGE_MULTIPLIER); AzeriteLevelInfoStorage = ReadDB2("AzeriteLevelInfo.db2", HotfixStatements.SEL_AZERITE_LEVEL_INFO); AzeritePowerStorage = ReadDB2("AzeritePower.db2", HotfixStatements.SEL_AZERITE_POWER); - AzeritePowerSetMemberStorage = ReadDB2 ("AzeritePowerSetMember.db2", HotfixStatements.SEL_AZERITE_POWER_SET_MEMBER); - AzeriteTierUnlockStorage = ReadDB2 ("AzeriteTierUnlock.db2", HotfixStatements.SEL_AZERITE_TIER_UNLOCK); - AzeriteTierUnlockSetStorage = ReadDB2 ("AzeriteTierUnlockSet.db2", HotfixStatements.SEL_AZERITE_TIER_UNLOCK_SET); - AzeriteUnlockMappingStorage = ReadDB2 ("AzeriteUnlockMapping.db2", HotfixStatements.SEL_AZERITE_UNLOCK_MAPPING); + AzeritePowerSetMemberStorage = ReadDB2("AzeritePowerSetMember.db2", HotfixStatements.SEL_AZERITE_POWER_SET_MEMBER); + AzeriteTierUnlockStorage = ReadDB2("AzeriteTierUnlock.db2", HotfixStatements.SEL_AZERITE_TIER_UNLOCK); + AzeriteTierUnlockSetStorage = ReadDB2("AzeriteTierUnlockSet.db2", HotfixStatements.SEL_AZERITE_TIER_UNLOCK_SET); + AzeriteUnlockMappingStorage = ReadDB2("AzeriteUnlockMapping.db2", HotfixStatements.SEL_AZERITE_UNLOCK_MAPPING); BankBagSlotPricesStorage = ReadDB2("BankBagSlotPrices.db2", HotfixStatements.SEL_BANK_BAG_SLOT_PRICES); BannedAddOnsStorage = ReadDB2("BannedAddons.db2", HotfixStatements.SEL_BANNED_ADDONS); BarberShopStyleStorage = ReadDB2("BarberShopStyle.db2", HotfixStatements.SEL_BARBER_SHOP_STYLE, HotfixStatements.SEL_BARBER_SHOP_STYLE_LOCALE); @@ -102,14 +102,14 @@ namespace Game.DataStorage ChrClassUIDisplayStorage = ReadDB2("ChrClassUIDisplay.db2", HotfixStatements.SEL_CHR_CLASS_UI_DISPLAY); ChrClassesStorage = ReadDB2("ChrClasses.db2", HotfixStatements.SEL_CHR_CLASSES, HotfixStatements.SEL_CHR_CLASSES_LOCALE); ChrClassesXPowerTypesStorage = ReadDB2("ChrClassesXPowerTypes.db2", HotfixStatements.SEL_CHR_CLASSES_X_POWER_TYPES); - ChrCustomizationChoiceStorage= ReadDB2("ChrCustomizationChoice.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_CHOICE, HotfixStatements.SEL_CHR_CUSTOMIZATION_CHOICE_LOCALE); - ChrCustomizationDisplayInfoStorage= ReadDB2("ChrCustomizationDisplayInfo.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_DISPLAY_INFO); - ChrCustomizationElementStorage =ReadDB2("ChrCustomizationElement.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_ELEMENT); - ChrCustomizationOptionStorage =ReadDB2("ChrCustomizationOption.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION, HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION_LOCALE); - ChrCustomizationReqStorage =ReadDB2("ChrCustomizationReq.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_REQ); - ChrCustomizationReqChoiceStorage =ReadDB2("ChrCustomizationReqChoice.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_REQ_CHOICE); - ChrModelStorage =ReadDB2("ChrModel.db2", HotfixStatements.SEL_CHR_MODEL); - ChrRaceXChrModelStorage =ReadDB2("ChrRaceXChrModel.db2", HotfixStatements.SEL_CHR_RACE_X_CHR_MODEL); + ChrCustomizationChoiceStorage = ReadDB2("ChrCustomizationChoice.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_CHOICE, HotfixStatements.SEL_CHR_CUSTOMIZATION_CHOICE_LOCALE); + ChrCustomizationDisplayInfoStorage = ReadDB2("ChrCustomizationDisplayInfo.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_DISPLAY_INFO); + ChrCustomizationElementStorage = ReadDB2("ChrCustomizationElement.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_ELEMENT); + ChrCustomizationOptionStorage = ReadDB2("ChrCustomizationOption.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION, HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION_LOCALE); + ChrCustomizationReqStorage = ReadDB2("ChrCustomizationReq.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_REQ); + ChrCustomizationReqChoiceStorage = ReadDB2("ChrCustomizationReqChoice.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_REQ_CHOICE); + ChrModelStorage = ReadDB2("ChrModel.db2", HotfixStatements.SEL_CHR_MODEL); + ChrRaceXChrModelStorage = ReadDB2("ChrRaceXChrModel.db2", HotfixStatements.SEL_CHR_RACE_X_CHR_MODEL); ChrRacesStorage = ReadDB2("ChrRaces.db2", HotfixStatements.SEL_CHR_RACES, HotfixStatements.SEL_CHR_RACES_LOCALE); ChrSpecializationStorage = ReadDB2("ChrSpecialization.db2", HotfixStatements.SEL_CHR_SPECIALIZATION, HotfixStatements.SEL_CHR_SPECIALIZATION_LOCALE); CinematicCameraStorage = ReadDB2("CinematicCamera.db2", HotfixStatements.SEL_CINEMATIC_CAMERA); diff --git a/Source/Game/Networking/Packets/ClientConfigPackets.cs b/Source/Game/Networking/Packets/ClientConfigPackets.cs index fc702bb9b..f985ea4df 100644 --- a/Source/Game/Networking/Packets/ClientConfigPackets.cs +++ b/Source/Game/Networking/Packets/ClientConfigPackets.cs @@ -36,7 +36,7 @@ namespace Game.Networking.Packets public ObjectGuid PlayerGuid; public long ServerTime; - public Array AccountTimes = new((int)AccountDataTypes.Max); + public long[] AccountTimes = new long[(int)AccountDataTypes.Max]; } public class ClientCacheVersion : ServerPacket diff --git a/Source/Game/Networking/Packets/MiscPackets.cs b/Source/Game/Networking/Packets/MiscPackets.cs index add033289..c127884bd 100644 --- a/Source/Game/Networking/Packets/MiscPackets.cs +++ b/Source/Game/Networking/Packets/MiscPackets.cs @@ -334,7 +334,7 @@ namespace Game.Networking.Packets _worldPacket.WriteUInt32(TutorialData[i]); } - public uint[] TutorialData = new uint[(int)Tutorials.Max]; + public uint[] TutorialData = new uint[SharedConst.MaxAccountTutorialValues]; } public class TutorialSetFlag : ClientPacket diff --git a/Source/Game/Server/WorldSession.cs b/Source/Game/Server/WorldSession.cs index 4d5409778..8befc1374 100644 --- a/Source/Game/Server/WorldSession.cs +++ b/Source/Game/Server/WorldSession.cs @@ -564,7 +564,7 @@ namespace Game public void SendTutorialsData() { TutorialFlags packet = new(); - Array.Copy(tutorials, packet.TutorialData, (int)AccountDataTypes.Max); + Array.Copy(tutorials, packet.TutorialData, SharedConst.MaxAccountTutorialValues); SendPacket(packet); }