Skip to content

Commit

Permalink
Fix season fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Oct 17, 2024
1 parent 3da6c86 commit 1fc7600
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions Fika.Core/Coop/GameMode/CoopGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public sealed class CoopGame : BaseLocalGame<EftGamePlayerOwner>, IBotGame, IFik
private DateTime? gameTime;
private TimeSpan? sessionTime;
private BotStateManager botStateManager;
private ESeason season;

public FikaDynamicAI DynamicAI { get; private set; }
public RaidSettings RaidSettings { get; private set; }
Expand Down Expand Up @@ -116,7 +117,18 @@ IWeatherCurve IBotGame.WeatherCurve
}
}

public ESeason Season { get; set; }
public ESeason Season
{
get
{
return season;
}
set
{
season = value;
Logger.LogInfo($"Setting Season to: {value}");
}
}

private static ManualLogSource Logger;

Expand Down Expand Up @@ -1585,20 +1597,15 @@ public override async Task vmethod_1(BotControllerSettings controllerSettings, I
if (WeatherController.Instance != null)
{
SetMatchmakerStatus(LocaleUtils.UI_INIT_WEATHER.Localized());
if (isServer && !OfflineRaidSettingsMenuPatch_Override.UseCustomWeather)
if (isServer)
{
LocalGame.Class1474 weatherHandler = new()
{
weather = iSession.WeatherRequest()
};
while (!weatherHandler.weather.IsCompleted)
GClass1287 weather = await iSession.WeatherRequest();
Season = weather.Season;
if (!OfflineRaidSettingsMenuPatch_Override.UseCustomWeather)
{
await Task.Yield();
WeatherClasses = weather.Weathers;
WeatherController.Instance.method_0(WeatherClasses);
}
WeatherClasses = weatherHandler.weather.Result.Weathers;
Season = weatherHandler.weather.Result.Season;
WeatherController.Instance.method_0(WeatherClasses);
weatherHandler = null;
}
else if (!isServer)
{
Expand Down

0 comments on commit 1fc7600

Please sign in to comment.