2020-02-28 21:07:39 +00:00
|
|
|
|
using OWML.ModHelper.Events;
|
2020-02-29 08:39:15 +00:00
|
|
|
|
using UnityEngine.Networking;
|
2020-02-18 20:32:26 +00:00
|
|
|
|
|
2020-02-24 18:55:16 +00:00
|
|
|
|
namespace QSB.TimeSync
|
2020-02-18 20:32:26 +00:00
|
|
|
|
{
|
2020-02-29 08:39:15 +00:00
|
|
|
|
public class PreserveTimeScale : NetworkBehaviour
|
2020-02-18 20:32:26 +00:00
|
|
|
|
{
|
2020-02-28 21:07:39 +00:00
|
|
|
|
private void Start()
|
2020-02-18 20:32:26 +00:00
|
|
|
|
{
|
2020-07-27 23:13:43 +00:00
|
|
|
|
QSB.Helper.Menus.PauseMenu.GetTitleButton("Button-EndCurrentLoop").Hide(); // Remove the meditation button
|
2020-02-29 08:39:15 +00:00
|
|
|
|
|
2020-07-27 23:13:43 +00:00
|
|
|
|
// Allow server to sleep at campfires
|
2020-02-29 08:39:15 +00:00
|
|
|
|
if (isServer)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-10 16:17:54 +00:00
|
|
|
|
var campfires = FindObjectsOfType<Campfire>();
|
2020-02-28 21:07:39 +00:00
|
|
|
|
foreach (var campfire in campfires)
|
2020-02-18 20:32:26 +00:00
|
|
|
|
{
|
2020-07-27 23:13:43 +00:00
|
|
|
|
campfire.SetValue("_canSleepHere", false); // Stop players from sleeping at campfires
|
2020-02-18 20:32:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|