I have a container with two items, and if I ever click an empty slot, it pauses the game and outputs this error.
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[AC.ContainerItem].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
AC.MenuInventoryBox.ClickContainer (MouseState _mouseState, Int32 _slot, AC.Container container) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:751)
AC.RuntimeInventory.ProcessInventoryBoxClick (AC.Menu _menu, AC.MenuInventoryBox inventoryBox, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Inventory/RuntimeInventory.cs:1183)
AC.MenuInventoryBox.ProcessClick (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:789)
AC.PlayerMenus.CheckClick (AC.Menu _menu, AC.MenuElement _element, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1239)
AC.PlayerMenus.CheckClicks (AC.Menu menu) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1052)
AC.PlayerMenus.UpdateAllMenus () (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1160)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:132)
Any ideas what the cause or fix would be?
Thanks,
Josh
Comments
if (container.items.Count > (_slot+offset) && container.items [_slot+offset] != null)
I'll make that a bugfix in the next release, too.