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