Fix PropStateExecute Task Bug

- The PropStateExecute task will not be handled correctly
This commit is contained in:
Somebody
2024-07-19 20:25:19 +08:00
parent 7d2c77e18d
commit c7779ad005
2 changed files with 4 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ namespace EggLink.DanhengServer.Data.Config.Task
{
public TargetEvaluator TargetType { get; set; } = new();
[JsonConverter(typeof(StringEnumConverter))]
public PropStateEnum PropState { get; set; } = PropStateEnum.Closed;
public PropStateEnum State { get; set; } = PropStateEnum.Closed;
public List<TaskConfigInfo> Execute { get; set; } = [];
public static new TaskConfigInfo LoadFromJsonObject(JObject obj)
@@ -30,9 +30,9 @@ namespace EggLink.DanhengServer.Data.Config.Task
info.TargetType = (targetType!.ToObject(classType!) as TargetEvaluator)!;
}
if (obj.ContainsKey(nameof(PropState)))
if (obj.ContainsKey(nameof(State)))
{
info.PropState = obj[nameof(PropState)]?.ToObject<PropStateEnum>() ?? PropStateEnum.Closed;
info.State = obj[nameof(State)]?.ToObject<PropStateEnum>() ?? PropStateEnum.Closed;
}
foreach (var item in obj[nameof(Execute)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)) ?? [])

View File

@@ -392,7 +392,7 @@ namespace EggLink.DanhengServer.GameServer.Game.Task
var resp = method.Invoke(this, [propStateExecute.TargetType, subMission, group]);
if (resp is EntityProp result && result != null)
{
result.SetState(propStateExecute.PropState);
result.SetState(propStateExecute.State);
}
}
}