Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SleepWithoutSpawn to work with Ashlands release #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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