mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 21:25:52 +12:00
Fix crashing on talking to npcs with 0 chatpoints.
This commit is contained in:
parent
d776d2adc3
commit
fa8f21388c
8 changed files with 214 additions and 10 deletions
|
@ -2745,9 +2745,22 @@ namespace HISP.Server
|
|||
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to start talking to an NPC with id that is NaN.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!Npc.NpcExists(chatId))
|
||||
{
|
||||
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to start talking to an NPC that doesnt exist.");
|
||||
return;
|
||||
}
|
||||
sender.LoggedinUser.MetaPriority = true;
|
||||
|
||||
Npc.NpcEntry entry = Npc.GetNpcById(chatId);
|
||||
|
||||
if(entry.Chatpoints.Length <= 0)
|
||||
{
|
||||
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to start talking to an NPC with no chatpoints.");
|
||||
return;
|
||||
}
|
||||
|
||||
int defaultChatpointId = Npc.GetDefaultChatpoint(sender.LoggedinUser, entry);
|
||||
|
||||
Npc.NpcChat startingChatpoint = Npc.GetNpcChatpoint(entry, defaultChatpointId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue