fix for GetDataHandlers: ERROR: System.IndexOutOfRangeException: Array index is out of range. in TShockAPI.PlayerData.StoreSlot

This commit is contained in:
Natrim 2012-01-11 11:06:08 +01:00
parent 5c5444dc83
commit 64b0a5c434

View file

@ -544,6 +544,11 @@ namespace TShockAPI
public void StoreSlot(int slot, int netID, int prefix, int stack)
{
if(slot > (this.inventory.Length - 1)) //if the slot is out of range then dont save
{
return;
}
this.inventory[slot].netID = netID;
if (this.inventory[slot].netID != 0)
{