From 55cfb48fd699485abe5d981dc97bd977ef2e3b50 Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Fri, 21 Feb 2025 16:55:54 +0100 Subject: [PATCH] add 250ms delay to wait for chara redraw --- MareSynchronos/Services/DalamudUtilService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MareSynchronos/Services/DalamudUtilService.cs b/MareSynchronos/Services/DalamudUtilService.cs index a398802..aa0fb63 100644 --- a/MareSynchronos/Services/DalamudUtilService.cs +++ b/MareSynchronos/Services/DalamudUtilService.cs @@ -338,12 +338,13 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber { if (!_clientState.IsLoggedIn) return; - logger.LogTrace("[{redrawId}] Starting wait for {handler} to draw", redrawId, handler); - const int tick = 250; int curWaitTime = 0; try { + logger.LogTrace("[{redrawId}] Starting wait for {handler} to draw", redrawId, handler); + await Task.Delay(tick).ConfigureAwait(true); + while ((!ct?.IsCancellationRequested ?? true) && curWaitTime < timeOut && await handler.IsBeingDrawnRunOnFrameworkAsync().ConfigureAwait(false)) // 0b100000000000 is "still rendering" or something