Fix bug with usedMax not only setting zero after max.

This commit is contained in:
Chandler Cox
2024-08-21 08:48:35 -05:00
parent a69a3812c2
commit b7b23dce5f

View File

@@ -2062,6 +2062,9 @@ namespace Flax.Build.Bindings
contents.Append(indent).Append(entryInfo.Name); contents.Append(indent).Append(entryInfo.Name);
if (!string.IsNullOrEmpty(entryInfo.Value)) if (!string.IsNullOrEmpty(entryInfo.Value))
{ {
if (usedMax)
usedMax = false;
string value; string value;
if (enumInfo.UnderlyingType != null) if (enumInfo.UnderlyingType != null)
{ {
@@ -2075,6 +2078,7 @@ namespace Flax.Build.Bindings
} }
contents.Append(" = ").Append(value); contents.Append(" = ").Append(value);
} }
// Handle case of next value after Max value being zero if a value is not defined.
else if (string.IsNullOrEmpty(entryInfo.Value) && usedMax) else if (string.IsNullOrEmpty(entryInfo.Value) && usedMax)
{ {
contents.Append(" = ").Append('0'); contents.Append(" = ").Append('0');