diff --git a/Source/Game/Chat/Commands/NPCCommands.cs b/Source/Game/Chat/Commands/NPCCommands.cs index 46ecadc0a..5b6beb5ea 100644 --- a/Source/Game/Chat/Commands/NPCCommands.cs +++ b/Source/Game/Chat/Commands/NPCCommands.cs @@ -658,6 +658,7 @@ namespace Game.Chat data.spawnId = guid; data.Id = id; data.spawnPoint.Relocate(chr.GetTransOffsetX(), chr.GetTransOffsetY(), chr.GetTransOffsetZ(), chr.GetTransOffsetO()); + data.spawnGroupData = new(); // @todo: add phases Creature _creature = trans.CreateNPCPassenger(guid, data); diff --git a/Source/Game/Chat/LanguageManager.cs b/Source/Game/Chat/LanguageManager.cs index 174b95f80..dfa27d907 100644 --- a/Source/Game/Chat/LanguageManager.cs +++ b/Source/Game/Chat/LanguageManager.cs @@ -100,7 +100,7 @@ namespace Game.Chat List FindWordGroup(uint language, uint wordLen) { - return _wordsMap.LookupByKey(Tuple.Create(language, wordLen)); + return _wordsMap.LookupByKey(Tuple.Create(language, (byte)wordLen)); } public string Translate(string msg, uint language, Locale locale) diff --git a/Source/Game/Entities/Player/Player.Quest.cs b/Source/Game/Entities/Player/Player.Quest.cs index a9e5bb1f9..18f75e4cf 100644 --- a/Source/Game/Entities/Player/Player.Quest.cs +++ b/Source/Game/Entities/Player/Player.Quest.cs @@ -2173,7 +2173,7 @@ namespace Game.Entities public void ItemRemovedQuestCheck(uint entry, uint count) { - foreach (var objectiveStatusData in m_questObjectiveStatus.LookupByKey(Tuple.Create(QuestObjectiveType.Item, entry))) + foreach (var objectiveStatusData in m_questObjectiveStatus.LookupByKey(Tuple.Create(QuestObjectiveType.Item, (int)entry))) { uint questId = objectiveStatusData.QuestStatusPair.Key; Quest quest = Global.ObjectMgr.GetQuestTemplate(questId); @@ -2381,7 +2381,7 @@ namespace Game.Entities public bool HasQuestForItem(uint itemid) { // Search incomplete objective first - foreach (var objectiveItr in m_questObjectiveStatus.LookupByKey(Tuple.Create(QuestObjectiveType.Item, itemid))) + foreach (var objectiveItr in m_questObjectiveStatus.LookupByKey(Tuple.Create(QuestObjectiveType.Item, (int)itemid))) { Quest qInfo = Global.ObjectMgr.GetQuestTemplate(objectiveItr.QuestStatusPair.Key); QuestObjective objective = objectiveItr.Objective; diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index db843d53a..de1aecc0a 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -3790,6 +3790,9 @@ namespace Game.Maps private Grid GetGrid(uint x, uint y) { + if (x > MapConst.MaxGrids || y > MapConst.MaxGrids) + return null; + return i_grids[x][y]; } diff --git a/Source/Game/Text/ChatTextBuilder.cs b/Source/Game/Text/ChatTextBuilder.cs index 3a9523fe8..97fd7c8d6 100644 --- a/Source/Game/Text/ChatTextBuilder.cs +++ b/Source/Game/Text/ChatTextBuilder.cs @@ -54,6 +54,7 @@ namespace Game.Chat AchievementId = achievementId; Locale = locale; + UntranslatedPacket = new(); UntranslatedPacket.Initialize(Type, Language, Sender, Receiver, Text, AchievementId, "", Locale); UntranslatedPacket.Write(); }