Skip to content

Commit

Permalink
Eliminate digit duplication on servers
Browse files Browse the repository at this point in the history
fixes #2
  • Loading branch information
Phlarx committed Dec 27, 2021
1 parent 48a8832 commit e9fc1f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions Thousandths.as
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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() {
Expand All @@ -100,7 +106,7 @@ void disable() {
string bytes_template_slow = "";
string bytes_ms_conversion = "";

print("Thousandths: patch removed");
trace("Thousandths: patch removed");
}

#if MP4
Expand Down Expand Up @@ -129,6 +135,11 @@ void Update(float dt) {
|| scriptPlayer.RaceState != CTrackManiaPlayer::ERaceState::Running) {
nextInGame = false;
}
auto serverInfo = GetApp().Network is null ? null : cast<CGameCtnNetServerInfo>(GetApp().Network.ServerInfo);
if(serverInfo !is null
&& serverInfo.ServerLogin.Length > 0) {
nextInGame = serverOverride;
}
}

if(inGame != nextInGame) {
Expand Down
2 changes: 1 addition & 1 deletion info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9fc1f0

Please sign in to comment.