From cc2e40dd9081d8420949ebf78a2cbe4c5438e89d Mon Sep 17 00:00:00 2001 From: VoxelDoesCode Date: Mon, 21 Nov 2022 20:19:58 -0500 Subject: [PATCH] Reset slice markers if invalid --- src/game/client/components/menus_demo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 6f5c765da..43fb9299c 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -513,8 +513,9 @@ void CMenus::RenderDemoPlayer(CUIRect MainView) static CButtonContainer s_SliceBeginButton; if(DoButton_FontIcon(&s_SliceBeginButton, "\xEF\x8B\xB5", 0, &Button, IGraphics::CORNER_ALL)) { - if(CurrentTick < (g_Config.m_ClDemoSliceEnd - pInfo->m_FirstTick) || g_Config.m_ClDemoSliceEnd == -1) - Client()->DemoSliceBegin(); + Client()->DemoSliceBegin(); + if(CurrentTick > (g_Config.m_ClDemoSliceEnd - pInfo->m_FirstTick)) + g_Config.m_ClDemoSliceEnd = -1; } GameClient()->m_Tooltips.DoToolTip(&s_SliceBeginButton, &Button, Localize("Mark the beginning of a cut")); @@ -524,8 +525,9 @@ void CMenus::RenderDemoPlayer(CUIRect MainView) static CButtonContainer s_SliceEndButton; if(DoButton_FontIcon(&s_SliceEndButton, "\xEF\x8B\xB6", 0, &Button, IGraphics::CORNER_ALL)) { - if(CurrentTick > (g_Config.m_ClDemoSliceBegin - pInfo->m_FirstTick) || g_Config.m_ClDemoSliceBegin == -1) - Client()->DemoSliceEnd(); + Client()->DemoSliceEnd(); + if(CurrentTick < (g_Config.m_ClDemoSliceBegin - pInfo->m_FirstTick)) + g_Config.m_ClDemoSliceBegin = -1; } GameClient()->m_Tooltips.DoToolTip(&s_SliceEndButton, &Button, Localize("Mark the end of a cut"));