From ff34e6ac3d0dae5112658d32a133f36c81932294 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Wed, 3 Nov 2021 23:52:46 +0600 Subject: [PATCH] Minor fixes --- src/hotkeys.cpp | 4 +++- src/pch.h | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 14c9c71..be99fc1 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -104,13 +104,15 @@ bool Hotkey::DrawUI(const char* label) bool Hotkey::Pressed() { if (KeyPressed(m_key1) && KeyPressed(m_key2)) + { m_bPressed = true; + } else { if (m_bPressed) { m_bPressed = false; - return m_CurrentHotkey == ""; + return (m_CurrentHotkey == ""); } } return false; diff --git a/src/pch.h b/src/pch.h index 39ccd24..8d52bfa 100644 --- a/src/pch.h +++ b/src/pch.h @@ -96,9 +96,10 @@ static void SetHelpMessage(const char *message, bool b1, bool b2, bool b3) #elif GTAVC CHud::SetHelpMessage(message, b1, b2); #else // GTA3 - const size_t cSize = strlen(message)+1; - wchar_t* wc = new wchar_t[cSize]; - mbstowcs (wc, message, cSize); - CHud::SetHelpMessage((wchar_t*)wc, b1); + const size_t size = strlen(message)+1; + wchar_t* wc = new wchar_t[size]; + mbstowcs(wc, message, size); + CHud::SetHelpMessage(wc, b1); + delete wc; #endif } \ No newline at end of file