yonilerner/cs2-retakes-allocator

Removing "Random" choice from config doesn't seem to work.

asapverneri opened this issue · 2 comments

I had "Random", removed from the config and new players wasnt getting any guns. Also getting this error time to time:

2024-01-13 18:24:36.622 +02:00 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Collections.Generic.KeyNotFoundException: The given key 'Spectator' was not present in the dictionary.
   at RetakesAllocatorCore.WeaponHelpers.GetWeaponForRoundType(RoundType roundType, CsTeam team, UserSetting userSetting) in /home/runner/work/cs2-retakes-allocator/cs2-retakes-allocator/RetakesAllocatorCore/WeaponHelpers.cs:line 296
   at RetakesAllocatorCore.WeaponHelpers.GetWeaponsForRoundType(RoundType roundType, CsTeam team, UserSetting userSetting) in /home/runner/work/cs2-retakes-allocator/cs2-retakes-allocator/RetakesAllocatorCore/WeaponHelpers.cs:line 222
   at RetakesAllocatorCore.OnRoundPostStartHelper.Handle[T](Nullable`1 nextRoundType, ICollection`1 allPlayers, Func`2 getSteamId, Func`2 getTeam, Action`1 giveDefuseKit, Action`3 allocateItemsForPlayer, RoundType& currentRoundType) in /home/runner/work/cs2-retakes-allocator/cs2-retakes-allocator/RetakesAllocatorCore/OnRoundPostStartHelper.cs:line 63
   at RetakesAllocator.RetakesAllocator.OnRoundPostStart(EventRoundPoststart event, GameEventInfo info) in /home/runner/work/cs2-retakes-allocator/cs2-retakes-allocator/RetakesAllocator/RetakesAllocator.cs:line 336
   at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

Will hopefully be fixed by #40. Will leave this issue open as I work to make sure it gets resolved

Closed by #40