Skip to content

[ERROR] "To Selected" option in menu #56

@Ketz1337

Description

@Ketz1337

When we click on the "To Selected" option in the menu, but no player model is selected the server console sends an error message. It's not a big issue, I just thought I'd point it out.

The error message can also be triggered by clicking the "To Selected" option in the main menu and then repeatedly pressing the "Select" button.

01:07:59 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at PlayerModelChanger.WasdModelMenu.Next(CCSPlayerController player) in E:\programming\CS2-PlayerModelChanger\commands\menu\ModelMenu.cs:line 195
   at PlayerModelChanger.ModelMenuPlayer.Next() in E:\programming\CS2-PlayerModelChanger\commands\menu\ModelMenuPlayer.cs:line 53
   at PlayerModelChanger.ModelMenuManager.Update() in E:\programming\CS2-PlayerModelChanger\commands\menu\ModelMenuManager.cs:line 76
   at PlayerModelChanger.PlayerModelChanger.OnTick() in E:\programming\CS2-PlayerModelChanger\PlayerModelChanger.cs:line 176
   at InvokeStub_OnTick.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.BasePlugin.<>c__DisplayClass51_0`1.<RegisterListener>b__2(ScriptContext context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/BasePlugin.cs:line 298
   at InvokeStub_Action`1.Invoke(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<CreateWrappedCallback>b__18_0(fxScriptContext* context)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions