diff --git a/QSB/EyeOfTheUniverse/CosmicInflation/InflationManager.cs b/QSB/EyeOfTheUniverse/CosmicInflation/InflationManager.cs index e66b70c7..fb259a67 100644 --- a/QSB/EyeOfTheUniverse/CosmicInflation/InflationManager.cs +++ b/QSB/EyeOfTheUniverse/CosmicInflation/InflationManager.cs @@ -30,11 +30,14 @@ namespace QSB.EyeOfTheUniverse.CosmicInflation { _playersInFog.Remove(QSBPlayerManager.GetPlayer(id)); - // count - 1 because this happens right before player is actually removed - if (_playersInFog.Count == QSBPlayerManager.PlayerList.Count - 1) + // wait 1 frame for player to be removed + QSBCore.UnityEvents.FireOnNextUpdate(() => { - StartCollapse(); - } + if (QSBCore.IsInMultiplayer && _playersInFog.Count == QSBPlayerManager.PlayerList.Count) + { + StartCollapse(); + } + }); } protected override void RebuildWorldObjects(OWScene scene) @@ -60,14 +63,18 @@ namespace QSB.EyeOfTheUniverse.CosmicInflation _controller._probeDestroyTrigger.SetTriggerActivation(false); new EnterLeaveMessage(EnterLeaveType.EnterCosmicFog).Send(); - DebugLog.DebugWrite("pause, disable input, wait for other players to enter"); - + DebugLog.DebugWrite("disable input, wait for other players to enter"); + + var repelVolume = (WhiteHoleFluidVolume)_controller._repelVolume; + repelVolume._flowSpeed = -repelVolume._flowSpeed; + repelVolume._massiveFlowSpeed = -repelVolume._massiveFlowSpeed; + repelVolume.SetVolumeActivation(true); + QSBPlayerManager.HideAllPlayers(); + ReticleController.Hide(); Locator.GetFlashlight().TurnOff(false); Locator.GetPromptManager().SetPromptsVisible(false); OWInput.ChangeInputMode(InputMode.None); - - OWTime.SetTimeScale(0); } } @@ -89,9 +96,10 @@ namespace QSB.EyeOfTheUniverse.CosmicInflation private void StartCollapse() { - DebugLog.DebugWrite("unpause, fade in everyone, fog sphere collapse"); - - OWTime.SetTimeScale(1); + DebugLog.DebugWrite("fade in everyone, fog sphere collapse"); + + var repelVolume = (WhiteHoleFluidVolume)_controller._repelVolume; + repelVolume.SetVolumeActivation(false); QSBPlayerManager.ShowAllPlayers(); _controller._state = CosmicInflationController.State.Collapsing; diff --git a/QSB/EyeOfTheUniverse/EyeStateSync/Messages/EyeStateMessage.cs b/QSB/EyeOfTheUniverse/EyeStateSync/Messages/EyeStateMessage.cs index 17e3d059..7f93814b 100644 --- a/QSB/EyeOfTheUniverse/EyeStateSync/Messages/EyeStateMessage.cs +++ b/QSB/EyeOfTheUniverse/EyeStateSync/Messages/EyeStateMessage.cs @@ -1,7 +1,6 @@ using QSB.Messaging; using QSB.Player; using QSB.Player.TransformSync; -using QSB.TimeSync; using QSB.WorldSync; namespace QSB.EyeOfTheUniverse.EyeStateSync.Messages @@ -25,22 +24,12 @@ namespace QSB.EyeOfTheUniverse.EyeStateSync.Messages public override void OnReceiveLocal() { QSBPlayerManager.LocalPlayer.EyeState = Value; - - if (Value >= EyeState.ForestIsDark) - { - WakeUpSync.LocalInstance.EyeDisable = true; - } } public override void OnReceiveRemote() { var player = QSBPlayerManager.GetPlayer(From); player.EyeState = Value; - - if (Value >= EyeState.ForestIsDark) - { - WakeUpSync.LocalInstance.EyeDisable = true; - } } } } \ No newline at end of file diff --git a/QSB/TimeSync/WakeUpSync.cs b/QSB/TimeSync/WakeUpSync.cs index c8d95164..31b27ff9 100644 --- a/QSB/TimeSync/WakeUpSync.cs +++ b/QSB/TimeSync/WakeUpSync.cs @@ -34,8 +34,6 @@ namespace QSB.TimeSync private int _serverLoopCount; private bool _hasWokenUp; - public bool EyeDisable; - public override void OnStartLocalPlayer() => LocalInstance = this; public void OnDisconnect() @@ -254,12 +252,6 @@ namespace QSB.TimeSync { UpdateClient(); } - - if (EyeDisable) - { - OnDisconnect(); - enabled = false; - } } private void UpdateServer()