fix: Fixes negative numbers in commands (#1343)
This commit is contained in:
parent
8a0b6c9731
commit
5fd0e94b7d
1 changed files with 5 additions and 2 deletions
|
|
@ -187,11 +187,14 @@ namespace Server
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsNumeric(type))
|
if (value.StartsWithOrdinal("0x") && IsNumeric(type))
|
||||||
{
|
{
|
||||||
try
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue