From db91df71fd140ea758125e41434749e1c3a527d2 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 8 Jul 2023 16:25:08 +0400 Subject: [PATCH] hw: Call OnTASPlaybackStopped() one frame later --- BunnymodXT/modules/HwDLL.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/BunnymodXT/modules/HwDLL.cpp b/BunnymodXT/modules/HwDLL.cpp index 62496ef9..6ab84665 100644 --- a/BunnymodXT/modules/HwDLL.cpp +++ b/BunnymodXT/modules/HwDLL.cpp @@ -5935,12 +5935,8 @@ void HwDLL::InsertCommands() // Ran through all frames. if (currentFramebulk >= totalFramebulks) { - CallOnTASPlaybackStopped(); runningFrames = false; - RenderYawOverrides.clear(); - RenderYawOverrideIndex = 0; - if (!exportFilename.empty()) { auto error = exportResult.Save(exportFilename); if (error.Code == HLTAS::ErrorCode::OK) @@ -5959,6 +5955,16 @@ void HwDLL::InsertCommands() } } else { if (wasRunningFrames) { + RenderYawOverrides.clear(); + RenderYawOverrideIndex = 0; + + if (bxt_on_tas_playback_frame) { + // We don't use the return value here because we stop anyway. + CallOnTASPlaybackFrame(); + } + + CallOnTASPlaybackStopped(); + ORIG_Cbuf_InsertText("host_framerate 0;_bxt_min_frametime 0;bxt_taslog 0\n"); if (sensitivityToRestore != 0) { std::ostringstream ss;