mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
Update PreserveTimeScale.cs
This commit is contained in:
parent
3b1083d670
commit
bedf8e3558
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user