Added check to HandleNpcTalk to ensure the passed NPC index is within
bounds (>= -1 && < `Main.maxNPCs`).
This commit is contained in:
parent
ce056f1ce5
commit
97f33fea63
2 changed files with 10 additions and 2 deletions
|
|
@ -3160,9 +3160,16 @@ namespace TShockAPI
|
|||
TShock.Log.ConsoleDebug("Bouncer / HandleNpcTalk rejected from bouncer throttle from {0}", args.Player.Name);
|
||||
return true;
|
||||
}
|
||||
|
||||
// -1 is a magic value, represents not talking to an NPC
|
||||
if (npc < -1 || npc >= Main.maxNPCs)
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / HandleNpcTalk rejected from bouncer out of bounds from {0}", args.Player.Name);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static bool HandlePlayerAnimation(GetDataHandlerArgs args)
|
||||
{
|
||||
if (OnPlayerAnimation(args.Player, args.Data))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue