Skip to content

Commit

Permalink
Allow RestartGameplay in Multiplayer
Browse files Browse the repository at this point in the history
tested for like 3 minutes and this doesnt break as many things as I expected so it gets a pass

keep in mind the tiny simplification made to restartgameplay here opens up a funny exploit that big brained themers can use to make fun of us for having an easy to break game but whatever
  • Loading branch information
poco0317 committed Nov 29, 2019
1 parent aed5f40 commit cabf0cd
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/Etterna/Screen/Gameplay/ScreenGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,10 @@ void
ScreenGameplay::RestartGameplay()
{
GAMESTATE->m_bRestartedGameplay = true;
SCREENMAN->GetTopScreen()->SetPrevScreenName("ScreenStageInformation");
if (m_sName.find("Net") != std::string::npos)
SetPrevScreenName("ScreenNetStageInformation");
else
SetPrevScreenName("ScreenStageInformation");
BeginBackingOutFromGameplay();
}

Expand Down Expand Up @@ -1373,21 +1376,16 @@ ScreenGameplay::Input(const InputEventPlus& input)
return false;
}

// RestartGameplay may only be pressed when in Singleplayer.
// Clever theming or something can probably break this, but we should at
// least try.
if (SCREENMAN->GetTopScreen()->GetPrevScreen() == "ScreenSelectMusic") {
/* Restart gameplay button moved from theme to allow for rebinding for
* people who dont want to edit lua files :)
*/
bool bHoldingRestart = false;
if (GAMESTATE->GetCurrentStyle(input.pn)->GameInputToColumn(
input.GameI) == Column_Invalid) {
bHoldingRestart |= input.MenuI == GAME_BUTTON_RESTART;
}
if (bHoldingRestart) {
RestartGameplay();
}
/* Restart gameplay button moved from theme to allow for rebinding for
* people who dont want to edit lua files :)
*/
bool bHoldingRestart = false;
if (GAMESTATE->GetCurrentStyle(input.pn)->GameInputToColumn(input.GameI) ==
Column_Invalid) {
bHoldingRestart |= input.MenuI == GAME_BUTTON_RESTART;
}
if (bHoldingRestart) {
RestartGameplay();
}

// handle a step or battle item activate
Expand Down

0 comments on commit cabf0cd

Please sign in to comment.