From 572c53d8879ec5d3bc0346d8015070b05af5225b Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:26:13 +0800 Subject: [PATCH] [saco] Implement/match `CGame::SetWorldTime(...)` --- saco/game/game.cpp | 10 ++++++++++ saco/game/game.h | 1 + saco/game/scripting.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/saco/game/game.cpp b/saco/game/game.cpp index f567162..64ba3c2 100644 --- a/saco/game/game.cpp +++ b/saco/game/game.cpp @@ -493,6 +493,16 @@ BOOL CGame::IsModelLoaded(int iModelID) //----------------------------------------------------------- // MATCH +void CGame::SetWorldTime(int iHour, int iMinute) +{ + *(PBYTE)0xB70152 = (BYTE)iMinute; + *(PBYTE)0xB70153 = (BYTE)iHour; + + ScriptCommand(&set_current_time, iHour, iMinute); +} + +//----------------------------------------------------------- + void CGame::GetWorldTime(BYTE* byteHour, BYTE* byteMinute) { *byteMinute = *(PBYTE)0xB70152; diff --git a/saco/game/game.h b/saco/game/game.h index c7ffaff..f099291 100644 --- a/saco/game/game.h +++ b/saco/game/game.h @@ -48,6 +48,7 @@ public: void LoadRequestedModels(); BOOL IsModelLoaded(int iModelID); + void SetWorldTime(int iHour, int iMinute); void GetWorldTime(BYTE* byteHour, BYTE* byteMinute); void ToggleThePassingOfTime(BYTE byteOnOff); void SetWorldWeather(int iWeatherID); diff --git a/saco/game/scripting.h b/saco/game/scripting.h index 6cd2eff..94dddc7 100644 --- a/saco/game/scripting.h +++ b/saco/game/scripting.h @@ -33,6 +33,9 @@ const SCRIPT_COMMAND request_model = { 0x0247, "i" }; // (CAR_*|BIKE_*|BOA const SCRIPT_COMMAND load_requested_models = { 0x038B, "" }; // -/- const SCRIPT_COMMAND fade = { 0x016A, "ii" }; // (time in ms), FADE_* + +const SCRIPT_COMMAND set_current_time = { 0x00C0, "ii" }; // Hours, Minutes + const SCRIPT_COMMAND is_model_available = { 0x0248, "i" }; // #MODEL const SCRIPT_COMMAND set_camera_behind_player = { 0x0373, "" }; // -/-