From ca3b173c4cdb53134b1d697f099a8446dc38b45c Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Wed, 19 Oct 2022 02:32:04 -0700 Subject: [PATCH] fix: Removes timer error for world in initial state, and removes OPL requirement for spellbooks (#1197) --- Projects/Server/Network/Packets/OutgoingContainerPackets.cs | 2 +- Projects/Server/Timer/Timer.cs | 4 ++-- Projects/UOContent/Multis/Houses/BaseHouse.cs | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Projects/Server/Network/Packets/OutgoingContainerPackets.cs b/Projects/Server/Network/Packets/OutgoingContainerPackets.cs index efda030f7..f04b68480 100644 --- a/Projects/Server/Network/Packets/OutgoingContainerPackets.cs +++ b/Projects/Server/Network/Packets/OutgoingContainerPackets.cs @@ -33,7 +33,7 @@ public static class OutgoingContainerPackets return; } - if (ObjectPropertyList.Enabled && ns.NewSpellbook) + if (ns.NewSpellbook) { ns.SendNewSpellbookContent(book, graphic, offset, content); } diff --git a/Projects/Server/Timer/Timer.cs b/Projects/Server/Timer/Timer.cs index f6d9a2870..c5c16f869 100644 --- a/Projects/Server/Timer/Timer.cs +++ b/Projects/Server/Timer/Timer.cs @@ -79,7 +79,7 @@ public partial class Timer public Timer Start() { - if (World.WorldState is WorldState.Initial or WorldState.Saving) + if (World.WorldState is WorldState.Saving) { logger.Error( "Attempted to start timer {Timer} ({HashCode}) while world is {State}\n{StackTrace}", @@ -123,7 +123,7 @@ public partial class Timer public void Stop() { - if (World.WorldState is WorldState.Initial or WorldState.Saving) + if (World.WorldState is WorldState.Saving) { logger.Error( "Attempted to stop timer {Timer} ({HashCode}) while world is {State}\n{StackTrace}", diff --git a/Projects/UOContent/Multis/Houses/BaseHouse.cs b/Projects/UOContent/Multis/Houses/BaseHouse.cs index b11216e86..ecdae3aa2 100644 --- a/Projects/UOContent/Multis/Houses/BaseHouse.cs +++ b/Projects/UOContent/Multis/Houses/BaseHouse.cs @@ -1197,7 +1197,10 @@ namespace Server.Multis { LockedDownFlag = 1; SecureFlag = 2; + } + public static void Initialize() + { Timer.DelayCall(TimeSpan.FromMinutes(1.0), TimeSpan.FromMinutes(1.0), Decay_OnTick); }