From 43f186edd18f1417ec0db796743e579d8df75330 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Wed, 6 Nov 2024 00:11:24 +0800 Subject: [PATCH] [saco] Implement/match `CGame::EnableClock(...)` --- saco/game/game.cpp | 18 ++++++++++++++++++ saco/game/game.h | 1 + 2 files changed, 19 insertions(+) diff --git a/saco/game/game.cpp b/saco/game/game.cpp index ce5ffb4..666b550 100644 --- a/saco/game/game.cpp +++ b/saco/game/game.cpp @@ -1044,6 +1044,24 @@ void CGame::DrawGangZone(float fPos[], DWORD dwColor) //----------------------------------------------------------- +void CGame::EnableClock(BYTE byteClock) +{ + BYTE byteClockData[] = {'%', '0', '2', 'd', ':', '%', '0', '2', 'd', 0}; + UnFuck(0x859A6C,10); + if (byteClock) + { + ToggleThePassingOfTime(1); + memcpy((PVOID)0x859A6C, byteClockData, 10); + } + else + { + ToggleThePassingOfTime(0); + memset((PVOID)0x859A6C,0,10); + } +} + +//----------------------------------------------------------- + void CGame::EnableZoneNames(BYTE byteEnable) { ScriptCommand(&enable_zone_names, byteEnable); diff --git a/saco/game/game.h b/saco/game/game.h index 8b3e70f..87bdec6 100644 --- a/saco/game/game.h +++ b/saco/game/game.h @@ -71,6 +71,7 @@ public: void ToggleRadar(int iToggle); void DisplayGameText(char *szStr,int iTime,int iSize); void SetGravity(float fGravity); + void EnableClock(BYTE byteClock); void EnableZoneNames(BYTE byteEnable); void SetWantedLevel(BYTE byteLevel); void SetGameTextCount(WORD wCount);