From 006c5ed03714a431447b2f0547b57806579ebcd7 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:32:00 -1000 Subject: [PATCH] fix: Fixes boat decay calculation (#2216) --- Projects/UOContent/Multis/Boats/BaseBoat.cs | 42 +++++---------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/Projects/UOContent/Multis/Boats/BaseBoat.cs b/Projects/UOContent/Multis/Boats/BaseBoat.cs index 9e367b455..6a6d68666 100644 --- a/Projects/UOContent/Multis/Boats/BaseBoat.cs +++ b/Projects/UOContent/Multis/Boats/BaseBoat.cs @@ -175,40 +175,16 @@ namespace Server.Multis [CommandProperty(AccessLevel.GameMaster)] public BoatOrder Order { get; set; } - public int Status - { - get + public int Status => + (Core.Now - (TimeOfDecay - BoatDecayDelay)) switch { - var start = Core.Now - TimeOfDecay - BoatDecayDelay; - - if (start < TimeSpan.FromHours(1.0)) - { - return 1043010; // This structure is like new. - } - - if (start < TimeSpan.FromDays(2.0)) - { - return 1043011; // This structure is slightly worn. - } - - if (start < TimeSpan.FromDays(3.0)) - { - return 1043012; // This structure is somewhat worn. - } - - if (start < TimeSpan.FromDays(4.0)) - { - return 1043013; // This structure is fairly worn. - } - - if (start < TimeSpan.FromDays(5.0)) - { - return 1043014; // This structure is greatly worn. - } - - return 1043015; // This structure is in danger of collapsing. - } - } + var start when start < TimeSpan.FromHours(1) => 1043010, // This structure is like new. + var start when start < TimeSpan.FromDays(2) => 1043011, // This structure is slightly worn. + var start when start < TimeSpan.FromDays(3) => 1043012, // This structure is somewhat worn. + var start when start < TimeSpan.FromDays(4) => 1043013, // This structure is fairly worn. + var start when start < TimeSpan.FromDays(5) => 1043014, // This structure is greatly worn. + _ => 1043015 // This structure is in danger of collapsing. + }; public virtual int NorthID => 0; public virtual int EastID => 0;