Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Discord Timer doesn't pause when a Singleplayer Scrum Game is paused #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix the Discord Timer not stopping when a Scrum Singleplayer Game is …
…paused.

(It stops then restarts from where it left off when unpaused - the offset is at most ±1 second)
Connierollstheball committed May 5, 2024
commit 68ab37679ad8f6ab57888a55d15b6c91e7440b66
8 changes: 8 additions & 0 deletions game/marble/server/scripts/game.cs
Original file line number Diff line number Diff line change
@@ -320,6 +320,9 @@ function pauseGame()
$saveTimescale = $timescale;

$timescale = $pauseTimescale;

//Stop the Discord Timer since the actual in-game Timer isn't running. ~Connie
XBLivePresenceStopTimer();
}
}
}
@@ -342,6 +345,11 @@ function resumeGame()
$saveTimescale = 1.0;
$timescale = $saveTimescale;
}

//Resume the Discord Timer if it's a Singleplayer game. ~Connie
if ($Server::ServerType $= "SinglePlayer" && $Game::Running && serverGetGameMode() $= "scrum" && ($Game::State $= "play" || $Game::State $= "go")) {
XBLivePresenceStartTimer(($Game::Duration - PlayGui.elapsedTime) / 1000);
}
}

function destroyGame()