Fixed an issue in NetGetData where e.Length - 1 would be -1

This commit is contained in:
White 2015-07-07 22:55:14 +09:30
parent 4ff861634c
commit 8f8e9d4cd4

View file

@ -1274,6 +1274,11 @@ namespace TShockAPI
return;
}
int length = e.Length - 1;
if (length < 0)
{
length = 0;
}
using (var data = new MemoryStream(e.Msg.readBuffer, e.Index, e.Length - 1))
{
// Exceptions are already handled