fix: 刷理智参数更新崩溃

This commit is contained in:
status102
2025-04-19 23:54:09 +08:00
parent 91195d3c02
commit 786518917c

View File

@@ -455,12 +455,11 @@ public class FightSettingsUserControlModel : TaskViewModel
get => _maxTimes;
set
{
if (MaxTimes == value)
if (SetAndNotify(ref _maxTimes, value))
{
return;
}
SetAndNotify(ref _maxTimes, value);
Instances.TaskQueueViewModel.SetFightParams();
ConfigurationHelper.SetValue(ConfigurationKeys.TimesLimitedQuantity, value.ToString());
}
@@ -476,12 +475,11 @@ public class FightSettingsUserControlModel : TaskViewModel
get => _series;
set
{
if (_series == value)
if (SetAndNotify(ref _series, value))
{
return;
}
SetAndNotify(ref _series, value);
Instances.TaskQueueViewModel.SetFightParams();
ConfigurationHelper.SetValue(ConfigurationKeys.SeriesQuantity, value.ToString());
}
@@ -499,7 +497,11 @@ public class FightSettingsUserControlModel : TaskViewModel
get => _isSpecifiedDropsWithNull;
set
{
SetAndNotify(ref _isSpecifiedDropsWithNull, value);
if (!SetAndNotify(ref _isSpecifiedDropsWithNull, value))
{
return;
}
Instances.TaskQueueViewModel.SetFightParams();
value ??= false;
ConfigurationHelper.SetValue(ConfigurationKeys.DropsEnable, value.ToString());
@@ -803,11 +805,7 @@ public class FightSettingsUserControlModel : TaskViewModel
ClientType = SettingsViewModel.GameSettings.ClientType,
};
if (string.IsNullOrEmpty(DropsItemId))
{
IsSpecifiedDrops = false;
}
else if (IsSpecifiedDrops)
if (IsSpecifiedDrops && !string.IsNullOrEmpty(DropsItemId))
{
task.Drops.Add(DropsItemId, DropsQuantity);
}