Fix WaitForObjectPosition to use actual data

pull/5/head
Liza 2024-06-09 22:43:45 +02:00
parent 6f4e84692c
commit 5332247103
Signed by: liza
GPG Key ID: 7199F8D727D55F67
1 changed files with 17 additions and 1 deletions

View File

@ -43,7 +43,16 @@ internal static class WaitAtEnd
return [new NextStep()];
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:
return [serviceProvider.GetRequiredService<WaitDelay>(), new NextStep()];
@ -103,6 +112,13 @@ internal static class WaitAtEnd
public uint DataId { 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 ETaskResult Update() =>