When using the bot to fight, and having only one spell set up, the bot sometimes crashes.
The crash happens in PeleaExtensiones.cs , Specifically on line 131 or 127. The index is out of bounds. It tries to do things with a spell at index 1 in the possible spells, but there is only one spell so this is out of bounds.
I saw that in another method in the same file, the index is checked before being used. This check is not present in this method, get_Procesar_Hechizo_Lanzado.
I added the check manually, as seen here:
This seemed to fix the issue for now.
For those curious, here was the stacktrace of the crash:
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source=mscorlib
StackTrace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Bot_Dofus_1._29._1.Otros.Peleas.PeleaExtensiones.d__15.MoveNext() in D:\Users\Joel\Documents\GitHub\Bot-Dofus-Retro-Master\Otros\Peleas\PeleaExtensiones.cs:line 125
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
When using the bot to fight, and having only one spell set up, the bot sometimes crashes.
The crash happens in PeleaExtensiones.cs , Specifically on line 131 or 127. The index is out of bounds. It tries to do things with a spell at index 1 in the possible spells, but there is only one spell so this is out of bounds.
I saw that in another method in the same file, the index is checked before being used. This check is not present in this method, get_Procesar_Hechizo_Lanzado.
I added the check manually, as seen here:
This seemed to fix the issue for now.
For those curious, here was the stacktrace of the crash:
System.ArgumentOutOfRangeException HResult=0x80131502 Message=Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Source=mscorlib StackTrace: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List`1.get_Item(Int32 index) at Bot_Dofus_1._29._1.Otros.Peleas.PeleaExtensiones.d__15.MoveNext() in D:\Users\Joel\Documents\GitHub\Bot-Dofus-Retro-Master\Otros\Peleas\PeleaExtensiones.cs:line 125
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()