AndreyMrovol / LethalWeatherTweaks

Changes to weather system in Lethal Company.
https://thunderstore.io/c/lethal-company/p/mrov/WeatherTweaks/
Other
3 stars 0 forks source link

When weights sum equals 0 the weather selection crashes #17

Closed AndreyMrovol closed 5 months ago

AndreyMrovol commented 5 months ago

[Debug :WeatherTweaks] ------------- [Debug :WeatherTweaks] 56 Vow [Debug :WeatherTweaks] previousDayWeather: None [Debug :WeatherTweaks] possibleWeathers: ["Flooded","Stormy","Foggy","Eclipsed"] [Debug :WeatherTweaks] Flooded has weight 0 [Debug :WeatherTweaks] Stormy has weight 0 [Debug :WeatherTweaks] Foggy has weight 0 [Debug :WeatherTweaks] Eclipsed has weight 0 [Debug :WeatherTweaks] 100 * 0 / 150 == 0 [Debug :WeatherTweaks] Scaling down clear weather weight from 100 to 0 [Debug :WeatherTweaks] None has weight 0 ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <787acc3c9a4c471ba7d971300105af24>:IL_0009 at WeatherTweaks.WeatherCalculation.NewWeathers (StartOfRound startOfRound) [0x004c3] in <76c2f325b42e426691dd795f7cdb1147>:IL_04C3 at WeatherTweaks.SetPlanetsWeatherPatch.GameMethodPatch (System.Int32 connectedPlayersOnServer, StartOfRound __instance) [0x0003a] in <76c2f325b42e426691dd795f7cdb1147>:IL_003A at (wrapper dynamic-method) StartOfRound.DMD(StartOfRound,int) at (wrapper dynamic-method) TimeOfDay.DMD(TimeOfDay) at (wrapper dynamic-method) StartOfRound.DMD(StartOfRound,int) at StartOfRound+d__260.MoveNext () [0x00397] in :IL_0397 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in :IL_0026

AndreyMrovol commented 5 months ago

This issue should be fixed in latest Stable release.