mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix many issues with SoftwareList-specific functionality
This commit is contained in:
@@ -155,8 +155,14 @@ namespace SabreTools.DatItems
|
||||
if (string.IsNullOrEmpty(fieldName) || !_internal.ContainsKey(fieldName!))
|
||||
return default;
|
||||
|
||||
// Get the value based on the type
|
||||
return _internal.ReadDouble(fieldName!);
|
||||
// Try to parse directly
|
||||
double? doubleValue = _internal.ReadDouble(fieldName!);
|
||||
if (doubleValue != null)
|
||||
return doubleValue;
|
||||
|
||||
// Try to parse from the string
|
||||
string? stringValue = _internal.ReadString(fieldName!);
|
||||
return NumberHelper.ConvertToDouble(stringValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -170,8 +176,14 @@ namespace SabreTools.DatItems
|
||||
if (string.IsNullOrEmpty(fieldName) || !_internal.ContainsKey(fieldName!))
|
||||
return default;
|
||||
|
||||
// Get the value based on the type
|
||||
return _internal.ReadLong(fieldName!);
|
||||
// Try to parse directly
|
||||
long? longValue = _internal.ReadLong(fieldName!);
|
||||
if (longValue != null)
|
||||
return longValue;
|
||||
|
||||
// Try to parse from the string
|
||||
string? stringValue = _internal.ReadString(fieldName!);
|
||||
return NumberHelper.ConvertToInt64(stringValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user