1
0
forked from liza/Questionable

Fix WaitForObjectPosition to use actual data

This commit is contained in:
Liza 2024-06-09 22:43:45 +02:00
parent 6f4e84692c
commit 5332247103
Signed by: liza
GPG Key ID: 7199F8D727D55F67

View File

@ -43,7 +43,16 @@ internal static class WaitAtEnd
return [new NextStep()]; return [new NextStep()];
case EInteractionType.WaitForObjectAtPosition: case EInteractionType.WaitForObjectAtPosition:
return [serviceProvider.GetRequiredService<WaitObjectAtPosition>(), new NextStep()]; ArgumentNullException.ThrowIfNull(step.DataId);
ArgumentNullException.ThrowIfNull(step.Position);
return
[
serviceProvider.GetRequiredService<WaitObjectAtPosition>()
.With(step.DataId.Value, step.Position.Value),
serviceProvider.GetRequiredService<WaitDelay>(),
new NextStep()
];
default: default:
return [serviceProvider.GetRequiredService<WaitDelay>(), new NextStep()]; return [serviceProvider.GetRequiredService<WaitDelay>(), new NextStep()];
@ -103,6 +112,13 @@ internal static class WaitAtEnd
public uint DataId { get; set; } public uint DataId { get; set; }
public Vector3 Destination { get; set; } public Vector3 Destination { get; set; }
public ITask With(uint dataId, Vector3 destination)
{
DataId = dataId;
Destination = destination;
return this;
}
public bool Start() => true; public bool Start() => true;
public ETaskResult Update() => public ETaskResult Update() =>