mooege/mooege — Issue #263: ArrayIndexOutOfBounds when moving an item to your stash
Author: dustinconrad
Created: 2011-10-31 06:50:57+00:00
State: open

When you try to move an item to your stash, you get an index out of bounds error

[Debug] [Server]: ReceiveCallback - [Exception] System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Mooege.Core.GS.Player.Equipment.GetEquipment(Int32 targetEquipSlot) in C:\Users\Dustin\mooege\src\Mooege\Core\GS\Player\Equipment.cs:line 137
at Mooege.Core.GS.Player.Inventory.HandleInventoryRequestMoveMessage(InventoryRequestMoveMessage request) in C:\Users\Dustin\mooege\src\Mooege\Core\GS\Player\Inventory.cs:line 128
at Mooege.Core.GS.Player.Inventory.Consume(GameClient client, GameMessage message) in C:\Users\Dustin\mooege\src\Mooege\Core\GS\Player\Inventory.cs:line 305
at Mooege.Core.GS.Game.Game.Route(GameClient client, GameMessage message) in C:\Users\Dustin\mooege\src\Mooege\Core\GS\Game\Game.cs:line 104
at Mooege.Net.GS.GameClient.Parse(ConnectionDataEventArgs e) in C:\Users\Dustin\mooege\src\Mooege\Net\GS\GameClient.cs:line 78
at Mooege.Net.GS.GameServer.GameServer_DataReceived(Object sender, ConnectionDataEventArgs e) in C:\Users\Dustin\mooege\src\Mooege\Net\GS\GameServer.cs:line38
at Mooege.Net.Server.OnDataReceived(ConnectionDataEventArgs e) in C:\Users\Dustin\mooege\src\Mooege\Net\Server.cs:line 216
at Mooege.Net.Server.ReceiveCallback(IAsyncResult result) in C:\Users\Dustin\mooege\src\Mooege\Net\Server.cs:line 127

[Debug] [Inventory]: request:
GameMessage(0x005A)
InventoryRequestMoveMessage:
{
ItemID: 0x00000093 (147)
InvLoc:
{
OwnerID: 0x00000089 (137)
EquipmentSlot: 0x00000011 (17)
Column: 0x00000003 (3)
Row: 0x00000000 (0)
}
}

The equipment slot is 17 for the stash it looks like. The code assumes anything that isn't zero is a character equip slot.. I tried to get a quick and dirty stash going but couldn't get the item to visually move from the characters inventory to the stash.