Update PreserveTimeScale.cs

This commit is contained in:
Mister_Nebula 2022-01-23 17:31:32 +00:00
parent 3b1083d670
commit bedf8e3558

View File

@ -6,20 +6,28 @@ namespace QSB.TimeSync
{
public void Init()
{
// disable meditation button;
Locator.GetSceneMenuManager().pauseMenu._skipToNextLoopButton.SetActive(false);
if (!isServer)
{
var campfires = FindObjectsOfType<Campfire>();
foreach (var campfire in campfires)
{
campfire._canSleepHere = false;
}
}
// Allow server to sleep at campfires
if (isServer)
var menuManager = Locator.GetSceneMenuManager();
if (menuManager == null)
{
return;
}
var campfires = FindObjectsOfType<Campfire>();
foreach (var campfire in campfires)
if (menuManager._pauseMenu == null || menuManager.pauseMenu._skipToNextLoopButton == null)
{
campfire._canSleepHere = false; // Stop players from sleeping at campfires
return;
}
menuManager.pauseMenu._skipToNextLoopButton.SetActive(false);
}
}
}