Fix some crashes
This commit is contained in:
@@ -658,6 +658,7 @@ namespace Game.Chat
|
|||||||
data.spawnId = guid;
|
data.spawnId = guid;
|
||||||
data.Id = id;
|
data.Id = id;
|
||||||
data.spawnPoint.Relocate(chr.GetTransOffsetX(), chr.GetTransOffsetY(), chr.GetTransOffsetZ(), chr.GetTransOffsetO());
|
data.spawnPoint.Relocate(chr.GetTransOffsetX(), chr.GetTransOffsetY(), chr.GetTransOffsetZ(), chr.GetTransOffsetO());
|
||||||
|
data.spawnGroupData = new();
|
||||||
// @todo: add phases
|
// @todo: add phases
|
||||||
|
|
||||||
Creature _creature = trans.CreateNPCPassenger(guid, data);
|
Creature _creature = trans.CreateNPCPassenger(guid, data);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
List<string> FindWordGroup(uint language, uint wordLen)
|
List<string> 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)
|
public string Translate(string msg, uint language, Locale locale)
|
||||||
|
|||||||
@@ -2173,7 +2173,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public void ItemRemovedQuestCheck(uint entry, uint count)
|
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;
|
uint questId = objectiveStatusData.QuestStatusPair.Key;
|
||||||
Quest quest = Global.ObjectMgr.GetQuestTemplate(questId);
|
Quest quest = Global.ObjectMgr.GetQuestTemplate(questId);
|
||||||
@@ -2381,7 +2381,7 @@ namespace Game.Entities
|
|||||||
public bool HasQuestForItem(uint itemid)
|
public bool HasQuestForItem(uint itemid)
|
||||||
{
|
{
|
||||||
// Search incomplete objective first
|
// 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);
|
Quest qInfo = Global.ObjectMgr.GetQuestTemplate(objectiveItr.QuestStatusPair.Key);
|
||||||
QuestObjective objective = objectiveItr.Objective;
|
QuestObjective objective = objectiveItr.Objective;
|
||||||
|
|||||||
@@ -3790,6 +3790,9 @@ namespace Game.Maps
|
|||||||
|
|
||||||
private Grid GetGrid(uint x, uint y)
|
private Grid GetGrid(uint x, uint y)
|
||||||
{
|
{
|
||||||
|
if (x > MapConst.MaxGrids || y > MapConst.MaxGrids)
|
||||||
|
return null;
|
||||||
|
|
||||||
return i_grids[x][y];
|
return i_grids[x][y];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace Game.Chat
|
|||||||
AchievementId = achievementId;
|
AchievementId = achievementId;
|
||||||
Locale = locale;
|
Locale = locale;
|
||||||
|
|
||||||
|
UntranslatedPacket = new();
|
||||||
UntranslatedPacket.Initialize(Type, Language, Sender, Receiver, Text, AchievementId, "", Locale);
|
UntranslatedPacket.Initialize(Type, Language, Sender, Receiver, Text, AchievementId, "", Locale);
|
||||||
UntranslatedPacket.Write();
|
UntranslatedPacket.Write();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user