From 5fd0e94b7d8de29efc8961380d08e08047419d23 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 17 Feb 2023 00:34:24 -0800 Subject: [PATCH] fix: Fixes negative numbers in commands (#1343) --- Projects/UOContent/Utilities/Types.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Projects/UOContent/Utilities/Types.cs b/Projects/UOContent/Utilities/Types.cs index 517f224ca..e04cd0462 100644 --- a/Projects/UOContent/Utilities/Types.cs +++ b/Projects/UOContent/Utilities/Types.cs @@ -187,11 +187,14 @@ namespace Server return null; } - if (IsNumeric(type)) + if (value.StartsWithOrdinal("0x") && IsNumeric(type)) { try { - constructed = Convert.ChangeType(Convert.ToUInt64(value), type); + if (ulong.TryParse(value.AsSpan(2), NumberStyles.HexNumber, null, out var num)) + { + constructed = Convert.ChangeType(num, type); + } return null; } catch