-3

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

Server stack trace:

   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at Mission.SetHeadQuarter(Player player, Int32 menuItemIndex)
   at Mission.MenuPartRadarOperations(Player player, Int32 id, Int32 menuItemIndex)
   at maddox.game.ABattle.OnOrderMissionMenuSelected(Player player, Int32 ID, Int32 menuItemIndex)
   at maddox.game.ABattle.OnEventGame(GameEventId eventId, Object eventArg0, Object eventArg1, Int32 eventArgInt)
   at maddox.game.world.Strategy.OnEventGame(GameEventId eventId, Object eventArg0, Object eventArg1, Int32 eventArgInt)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at maddox.game.IBattle.OnEventGame(GameEventId eventId, Object eventArg0, Object eventArg1, Int32 eventArgInt)
   at maddox.game.GameDef.eventGame(GameEventId eventId, Object eventArg0, Object eventArg1, Int32 eventArgInt)
   at y45c1v2ebB$KGoVuDLAOgPveOWCjmls4YNlJvUerFjtA.s$bfu6e1CXdvl0HcORTAHEE(GameEventId , Object , Object , Int32 )
Sach
  • 10,091
  • 8
  • 47
  • 84
  • 1
    How are we supposed to tell you what is wrong with your code (beyond a general answer) without seeing any code? – Broots Waymb Jun 19 '19 at 16:41
  • 1
    Welcome to SO. With what you've posted all we can say is that an exception occurred in `maddox.game.world.Strategy.OnEventGame()` and that's all. Please take a look at this https://stackoverflow.com/help/minimal-reproducible-example and post a proper question. You should post your code, and point to the exact place where you get the error. – Sach Jun 19 '19 at 16:43
  • 2
    Simply by looking at your error, it's obvious that you're adding something to a collection at an index that doesn't exist. – Sach Jun 19 '19 at 16:44

1 Answers1

-1

You got an ArgumentOutOfRangeException. Probably you would like to iterate through a collection and the index which you use is negative or higher than the size of the collection as you can read it in the error message. Double check the size of your collection and your index value and next time please add some code to your question.

Ezayex
  • 81
  • 6