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
8 changes: 8 additions & 0 deletions game/marble/server/scripts/game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand All @@ -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()
Expand Down