From e9fc1f0f0e2e268884c9823b9a818da2060e00fd Mon Sep 17 00:00:00 2001 From: Phlarx Date: Mon, 27 Dec 2021 17:19:16 -0600 Subject: [PATCH] Eliminate digit duplication on servers fixes #2 --- Thousandths.as | 15 +++++++++++++-- info.toml | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Thousandths.as b/Thousandths.as index 370288d..6bfbb9e 100644 --- a/Thousandths.as +++ b/Thousandths.as @@ -1,5 +1,11 @@ [Setting name="Enabled"] bool enabled = true; + +#if MP4 +[Setting name="Force enable on servers" description="Most servers will already display thousandths; enabling this might duplicate the last digit"] +bool serverOverride = false; +#endif + bool errored = false; uint64 ptr_template_fast = 0; @@ -86,7 +92,7 @@ void enable() { bytes_ms_conversion = Dev::Patch(ptr_ms_conversion, "90 90 90 90 90 45 2B D0 41 8B D2 48 8B 44 24 30 90 90 90"); #endif - print("Thousandths: patch applied"); + trace("Thousandths: patch applied"); } void disable() { @@ -100,7 +106,7 @@ void disable() { string bytes_template_slow = ""; string bytes_ms_conversion = ""; - print("Thousandths: patch removed"); + trace("Thousandths: patch removed"); } #if MP4 @@ -129,6 +135,11 @@ void Update(float dt) { || scriptPlayer.RaceState != CTrackManiaPlayer::ERaceState::Running) { nextInGame = false; } + auto serverInfo = GetApp().Network is null ? null : cast(GetApp().Network.ServerInfo); + if(serverInfo !is null + && serverInfo.ServerLogin.Length > 0) { + nextInGame = serverOverride; + } } if(inGame != nextInGame) { diff --git a/info.toml b/info.toml index 9f06790..a19f983 100644 --- a/info.toml +++ b/info.toml @@ -4,7 +4,7 @@ author = "Phlarx" category = "Race" siteid = 151 -version = "0.1" +version = "0.2" [game] # since this is for Turbo and MP4, max_version is just to catch the