mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-02 05:06:35 -05:00
fix value==int.MinValue bug in script parsing
This commit is contained in:
@@ -125,7 +125,7 @@ namespace HavenSoft.HexManiac.Core.Models.Code {
|
||||
var enumName = EnumTableName?.Split('|')[0];
|
||||
var table = string.IsNullOrEmpty(enumName) ? null : model.GetOptions(enumName);
|
||||
if (table == null || value - EnumOffset < 0 || table.Count <= value - EnumOffset || string.IsNullOrEmpty(table[value])) {
|
||||
preferHex |= Math.Abs(value).InRange(0x4000, 20000) || Math.Abs(value) > 20100;
|
||||
if (value != int.MinValue) preferHex |= Math.Abs(value).InRange(0x4000, 20000) || Math.Abs(value) > 20100;
|
||||
if (preferHex || value == int.MinValue) {
|
||||
return "0x" + ((uint)(value - EnumOffset)).ToString($"X{length * 2}");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user