Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions SleepWithoutSpawn/BepInExPlugin.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ static class Bed_Interact_Patch
{
static bool Prefix(Bed __instance, Humanoid human, bool repeat, ref bool __result, ZNetView ___m_nview)
{
if (((!allowDaySleep.Value || EnvMan.instance.IsAfternoon() || EnvMan.instance.IsNight()) && Traverse.Create(__instance).Method("IsCurrent").GetValue<bool>()) || repeat || !AedenthornUtils.CheckKeyHeld(modKey.Value) || (unclaimedOnly.Value && ___m_nview.GetZDO().GetLong("owner", 0L) != 0))
if (((!allowDaySleep.Value || EnvMan.IsAfternoon() || EnvMan.IsNight()) && Traverse.Create(__instance).Method("IsCurrent").GetValue<bool>()) || repeat || !AedenthornUtils.CheckKeyHeld(modKey.Value) || (unclaimedOnly.Value && ___m_nview.GetZDO().GetLong("owner", 0L) != 0))
{
return true;
}
Dbgl($"trying to sleep on bed");

Player player = human as Player;

if (!allowDaySleep.Value && !EnvMan.instance.IsAfternoon() && !EnvMan.instance.IsNight())
if (!allowDaySleep.Value && !EnvMan.IsAfternoon() && !EnvMan.IsNight())
{
human.Message(MessageHud.MessageType.Center, "$msg_cantsleep", 0, null);
__result = false;
Expand Down