From 64b0a5c434f706c463b2592a498862f3271af232 Mon Sep 17 00:00:00 2001 From: Natrim Date: Wed, 11 Jan 2012 11:06:08 +0100 Subject: [PATCH] fix for GetDataHandlers: ERROR: System.IndexOutOfRangeException: Array index is out of range. in TShockAPI.PlayerData.StoreSlot --- TShockAPI/TSPlayer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 582ff638..b828cacf 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -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) {