diff --git a/Projects/Server/Mobiles/Mobile.cs b/Projects/Server/Mobiles/Mobile.cs index d112a5434..3a7803cb9 100644 --- a/Projects/Server/Mobiles/Mobile.cs +++ b/Projects/Server/Mobiles/Mobile.cs @@ -9,6 +9,7 @@ using Server.Guilds; using Server.Gumps; using Server.HuePickers; using Server.Items; +using Server.Logging; using Server.Menus; using Server.Mobiles; using Server.Network; @@ -408,6 +409,8 @@ namespace Server // Allow four warmode changes in 0.5 seconds, any more will be delay for two seconds private const int WarmodeCatchCount = 4; + private static readonly ILogger logger = LogFactory.GetLogger(typeof(Mobile)); + // TODO: Make these configurations private static readonly TimeSpan WarmodeSpamCatch = TimeSpan.FromSeconds(Core.SE ? 1.0 : 0.5); private static readonly TimeSpan WarmodeSpamDelay = TimeSpan.FromSeconds(Core.SE ? 4.0 : 2.0); @@ -5191,13 +5194,20 @@ namespace Server item.Spawner = null; } - amount = Math.Clamp(amount, 1, item.Amount); - var oldAmount = item.Amount; - if (amount < oldAmount) + if (oldAmount <= 0) { - LiftItemDupe(item, amount); + logger.Error($"Item {item.GetType()} ({item.Serial}) has amount of {oldAmount}, but must be at least 1"); + } + else + { + amount = Math.Clamp(amount, 1, oldAmount); + + if (amount < oldAmount) + { + LiftItemDupe(item, amount); + } } var map = from.Map; diff --git a/Projects/Server/Network/Packets/IncomingAccountPackets.cs b/Projects/Server/Network/Packets/IncomingAccountPackets.cs index 4444b95ad..b7f1eebb5 100644 --- a/Projects/Server/Network/Packets/IncomingAccountPackets.cs +++ b/Projects/Server/Network/Packets/IncomingAccountPackets.cs @@ -318,6 +318,8 @@ namespace Server.Network state.SendSeasonChange((byte)m.GetSeason(), true); state.SendMapChange(m.Map); + state.SendPlayMusic(m.Region.Music); + EventSink.InvokeLogin(m); } diff --git a/Projects/UOContent/Commands/Properties.cs b/Projects/UOContent/Commands/Properties.cs index 21a3e25b0..4ff86a699 100644 --- a/Projects/UOContent/Commands/Properties.cs +++ b/Projects/UOContent/Commands/Properties.cs @@ -72,7 +72,7 @@ namespace Server.Commands if (attr == null) { - failReason = $"Property '${propertyName}' not found."; + failReason = $"Property '{propertyName}' not found."; return null; } diff --git a/Projects/UOContent/Gumps/ClientGump.cs b/Projects/UOContent/Gumps/ClientGump.cs index 9084b8baf..4d10f2405 100644 --- a/Projects/UOContent/Gumps/ClientGump.cs +++ b/Projects/UOContent/Gumps/ClientGump.cs @@ -272,7 +272,7 @@ namespace Server.Gumps { focus.Say("I've been kicked!"); - m_State.Disconnect($"Kicked by ${from}."); + m_State.Disconnect($"Kicked by {from}."); CommandLogging.WriteLine( from,