From: Liza Carvelli Date: Sun, 9 Jun 2024 20:43:45 +0000 (+0200) Subject: Fix WaitForObjectPosition to use actual data X-Git-Tag: v0.7~1 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=5332247103c8510dbfccf339618278e9e4f4ca0e;p=Questionable.git Fix WaitForObjectPosition to use actual data --- diff --git a/Questionable/Controller/Steps/BaseFactory/WaitAtEnd.cs b/Questionable/Controller/Steps/BaseFactory/WaitAtEnd.cs index 01d5c753..e0519faf 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() =>