From d92256c9ac5061a03532a51146a8ccf6de7f645c Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 28 Jul 2024 22:54:55 +0800 Subject: [PATCH] [saco] Implement/match `CGame::IsKeyPressed(...)` --- saco/game/game.cpp | 11 +++++++++++ saco/game/game.h | 1 + 2 files changed, 12 insertions(+) diff --git a/saco/game/game.cpp b/saco/game/game.cpp index a7a64e4..4f14a44 100644 --- a/saco/game/game.cpp +++ b/saco/game/game.cpp @@ -117,6 +117,17 @@ int CGame::GetWeaponModelIDFromWeapon(int iWeaponID) //----------------------------------------------------------- +BOOL CGame::IsKeyPressed(int iKeyIdentifier) +{ + GTA_CONTROLSET * pControlSet = GameGetInternalKeys(); + + if(pControlSet->wKeys1[iKeyIdentifier]) return TRUE; + + return FALSE; +} + +//----------------------------------------------------------- + void CGame::InitGame() { // Create a buffer for game text. diff --git a/saco/game/game.h b/saco/game/game.h index e6f69e3..903f514 100644 --- a/saco/game/game.h +++ b/saco/game/game.h @@ -37,6 +37,7 @@ private: public: int GetWeaponModelIDFromWeapon(int iWeaponID); + BOOL IsKeyPressed(int iKeyIdentifier); void StartGame(); void InitGame(); BOOL IsGameLoaded();