diff --git a/Fika.Core/Coop/GameMode/CoopGame.cs b/Fika.Core/Coop/GameMode/CoopGame.cs index 04f3c154..af4377a4 100644 --- a/Fika.Core/Coop/GameMode/CoopGame.cs +++ b/Fika.Core/Coop/GameMode/CoopGame.cs @@ -1061,7 +1061,7 @@ public async Task InitPlayer(BotControllerSettings botsSettings, string backendU } if (transitActive) { - Singleton.Instance.TransitController = isServer ? new FikaHostTransitController(instance.transitSettings, Location_0.transitParameters, + gameWorld.TransitController = isServer ? new FikaHostTransitController(instance.transitSettings, Location_0.transitParameters, Profile_0, localRaidSettings_0) : new FikaClientTransitController(instance.transitSettings, Location_0.transitParameters, Profile_0, localRaidSettings_0); } @@ -1089,6 +1089,11 @@ public async Task InitPlayer(BotControllerSettings botsSettings, string backendU PlayerCameraController.Create(gparam_0.Player); CameraClass.Instance.SetOcclusionCullingEnabled(Location_0.OcculsionCullingEnabled); CameraClass.Instance.IsActive = false; + + if (FikaBackendUtils.IsDedicated && gameWorld.TransitController is FikaHostTransitController hostController) + { + hostController.SetupDedicatedPlayerTransitStash(player); + } } await WaitForPlayersToConnect(); diff --git a/Fika.Core/Coop/HostClasses/FikaHostTransitController.cs b/Fika.Core/Coop/HostClasses/FikaHostTransitController.cs index a6e0bcfa..f78c092c 100644 --- a/Fika.Core/Coop/HostClasses/FikaHostTransitController.cs +++ b/Fika.Core/Coop/HostClasses/FikaHostTransitController.cs @@ -30,13 +30,12 @@ public FikaHostTransitController(BackendConfigSettingsClass.GClass1529 settings, playersInTransitZone = []; dediTransit = false; transittedPlayers = []; + } - if (FikaBackendUtils.IsDedicated) - { - CoopPlayer dediPlayer = (CoopPlayer)GamePlayerOwner.MyPlayer; - TransferItemsController.InitPlayerStash(dediPlayer); - dediPlayer.UpdateBtrTraderServiceData().HandleExceptions(); - } + public void SetupDedicatedPlayerTransitStash(LocalPlayer player) + { + TransferItemsController.InitPlayerStash(player); + player.UpdateBtrTraderServiceData().HandleExceptions(); } private readonly LocalRaidSettings localRaidSettings;