stage reward for item type

This commit is contained in:
rfi
2023-11-24 20:01:26 +07:00
parent cf82daad00
commit 1f4b0b660f
7 changed files with 151 additions and 36 deletions

View File

@@ -106,10 +106,12 @@ namespace AscNet.Common.Util
prop.PropertyType.GetMethod("Add").Invoke(prop.GetValue(obj), new object[] { value });
}
}
else if (prop.PropertyType == typeof(int))
else if (prop.PropertyType == typeof(int) || prop.PropertyType == typeof(int?))
{
// For int properties like GroupId
prop.SetValue(obj, int.Parse(values[i]));
if (!string.IsNullOrEmpty(values[i]))
prop.SetValue(obj, int.Parse(values[i]));
else
prop.SetValue(obj, null);
}
else
{