From b6bc5d1884ab9bd99993402cbb4b81ab2b9df734 Mon Sep 17 00:00:00 2001 From: Tater Date: Sun, 6 Oct 2024 22:45:48 -0500 Subject: [PATCH 1/2] apply exponential easing to smooth camera --- src/game/client/components/camera.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/camera.cpp b/src/game/client/components/camera.cpp index 307f3c32618..d57840a0dcc 100644 --- a/src/game/client/components/camera.cpp +++ b/src/game/client/components/camera.cpp @@ -39,7 +39,8 @@ CCamera::CCamera() float CCamera::CameraSmoothingProgress(float CurrentTime) const { - return (CurrentTime - m_CameraSmoothingStart) / (m_CameraSmoothingEnd - m_CameraSmoothingStart); + float Progress = (CurrentTime - m_CameraSmoothingStart) / (m_CameraSmoothingEnd - m_CameraSmoothingStart); + return 1.0 - std::pow(2.0, -10.0 * Progress); } float CCamera::ZoomProgress(float CurrentTime) const From 6d7aeaba1c0b3e6a89ce80848ce699b59c86565a Mon Sep 17 00:00:00 2001 From: KebsCS Date: Mon, 7 Oct 2024 16:07:26 +0200 Subject: [PATCH 2/2] Fix color validation in some commands --- src/engine/shared/console.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index c7e0fb4d244..360bbba74d4 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -511,7 +511,15 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientId, bo if(Stroke || IsStrokeCommand) { - if(int Error = ParseArgs(&Result, pCommand->m_pParams, pCommand->m_pfnCallback == &SColorConfigVariable::CommandCallback)) + bool IsColor = false; + { + FCommandCallback pfnCallback = pCommand->m_pfnCallback; + void *pUserData = pCommand->m_pUserData; + TraverseChain(&pfnCallback, &pUserData); + IsColor = pfnCallback == &SColorConfigVariable::CommandCallback; + } + + if(int Error = ParseArgs(&Result, pCommand->m_pParams, IsColor)) { char aBuf[CMDLINE_LENGTH + 64]; if(Error == PARSEARGS_INVALID_INTEGER)