diff --git a/Questionable/Controller/Steps/BaseFactory/WaitAtEnd.cs b/Questionable/Controller/Steps/BaseFactory/WaitAtEnd.cs index 01d5c7539..e0519faf6 100644 --- a/Questionable/Controller/Steps/BaseFactory/WaitAtEnd.cs +++ b/Questionable/Controller/Steps/BaseFactory/WaitAtEnd.cs @@ -43,7 +43,16 @@ internal static class WaitAtEnd return [new NextStep()]; case EInteractionType.WaitForObjectAtPosition: - return [serviceProvider.GetRequiredService(), new NextStep()]; + ArgumentNullException.ThrowIfNull(step.DataId); + ArgumentNullException.ThrowIfNull(step.Position); + + return + [ + serviceProvider.GetRequiredService() + .With(step.DataId.Value, step.Position.Value), + serviceProvider.GetRequiredService(), + new NextStep() + ]; default: return [serviceProvider.GetRequiredService(), 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() =>