Fix npc chat being invisible

This commit is contained in:
Bluzume 2021-11-28 15:23:41 -05:00
parent 93af9a3be5
commit 088a4948d7
2 changed files with 8 additions and 5 deletions

View file

@ -748,6 +748,8 @@ namespace HISP.Game
} }
public static string BuildRealTimeQuiz(RealTimeQuiz.Participent participent) public static string BuildRealTimeQuiz(RealTimeQuiz.Participent participent)
{ {
// Uber Priority xD
participent.UserInstance.MinorPriority = true;
participent.UserInstance.MajorPriority = true; participent.UserInstance.MajorPriority = true;
return Messages.FormatEventRealTimeQuizMeta(participent.CorrectAnswers, participent.MistakenAnswers, participent.OnQuestion.BaseCategory.Name, participent.OnQuestion.Question); return Messages.FormatEventRealTimeQuizMeta(participent.CorrectAnswers, participent.MistakenAnswers, participent.OnQuestion.BaseCategory.Name, participent.OnQuestion.Question);
} }
@ -2555,8 +2557,11 @@ namespace HISP.Game
Npc.SetDefaultChatpoint(user, npc, result.SetChatpoint); Npc.SetDefaultChatpoint(user, npc, result.SetChatpoint);
if (result.GotoChatpoint != -1) if (result.GotoChatpoint != -1)
chatpoint = Npc.GetNpcChatpoint(npc, result.GotoChatpoint); chatpoint = Npc.GetNpcChatpoint(npc, result.GotoChatpoint);
if (result.NpcChat != null)
chatpoint.ChatText = result.NpcChat; if (chatpoint.ChatText.Trim() == "")
if (result.NpcChat != null)
if(result.NpcChat.Trim() != "")
chatpoint.ChatText = result.NpcChat;
} }
else else
{ {

View file

@ -5259,6 +5259,7 @@ namespace HISP.Server
string packetStr = Encoding.UTF8.GetString(packet); string packetStr = Encoding.UTF8.GetString(packet);
string number = packetStr.Substring(2, packetStr.Length - 4); string number = packetStr.Substring(2, packetStr.Length - 4);
int chatId = 0; int chatId = 0;
try try
{ {
chatId = int.Parse(number); chatId = int.Parse(number);
@ -5268,14 +5269,12 @@ namespace HISP.Server
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to start talking to an NPC with id that is NaN."); Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to start talking to an NPC with id that is NaN.");
return; return;
} }
if(!Npc.NpcExists(chatId)) if(!Npc.NpcExists(chatId))
{ {
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to start talking to an NPC that doesnt exist."); Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to start talking to an NPC that doesnt exist.");
return; return;
} }
sender.LoggedinUser.MajorPriority = true; sender.LoggedinUser.MajorPriority = true;
Npc.NpcEntry entry = Npc.GetNpcById(chatId); Npc.NpcEntry entry = Npc.GetNpcById(chatId);
if(entry.Chatpoints.Length <= 0) if(entry.Chatpoints.Length <= 0)
@ -5285,7 +5284,6 @@ namespace HISP.Server
} }
int defaultChatpointId = Npc.GetDefaultChatpoint(sender.LoggedinUser, entry); int defaultChatpointId = Npc.GetDefaultChatpoint(sender.LoggedinUser, entry);
Npc.NpcChat startingChatpoint = Npc.GetNpcChatpoint(entry, defaultChatpointId); Npc.NpcChat startingChatpoint = Npc.GetNpcChatpoint(entry, defaultChatpointId);
string metaInfo = Meta.BuildNpcChatpoint(sender.LoggedinUser, entry, startingChatpoint); string metaInfo = Meta.BuildNpcChatpoint(sender.LoggedinUser, entry, startingChatpoint);