Skip to content

Commit

Permalink
Fix linux crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram authored Oct 7, 2018
1 parent 34effcc commit 893cb47
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions src/ScreenGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2960,22 +2960,15 @@ class LunaScreenGameplay : public Luna<ScreenGameplay>
static int SetReplayPosition(T* p, lua_State* L)
{
float newpos = FArg(1);
if (!GAMESTATE->GetPaused()) {
/*
SCREENMAN->SystemMessage(
"You must be paused to move the song position of a Replay.");
*/
return 0;
if (GAMESTATE->GetPaused() && GamePreferences::m_AutoPlay == PC_REPLAY) {
p->SetSongPosition(newpos);
}
if (GamePreferences::m_AutoPlay != PC_REPLAY) {
/*
/*
else
SCREENMAN->SystemMessage(
"You cannot move the song position outside of a Replay.");
*/
return 0;
}
p->SetSongPosition(newpos);
return 1;
"You must be paused to move the song position of a Replay.");
*/
return 0;
}
static int SetReplayRate(T* p, lua_State* L)
{
Expand All @@ -2986,15 +2979,15 @@ class LunaScreenGameplay : public Luna<ScreenGameplay>
"You must be paused to change the rate of a Replay.");
*/
lua_pushnumber(L, -1.f);
return 0;
return 1;
}
if (GamePreferences::m_AutoPlay != PC_REPLAY) {
/*
SCREENMAN->SystemMessage(
"You cannot change the rate outside of a Replay.");
*/
lua_pushnumber(L, -1.f);
return 0;
return 1;
}
lua_pushnumber(L, p->SetRate(newrate));
return 1;
Expand All @@ -3009,14 +3002,14 @@ class LunaScreenGameplay : public Luna<ScreenGameplay>
return 0;
}
p->ToggleReplayPause();
return 1;
return 0;
}
static int SetReplayBookmark(T* p, lua_State* L)
{
float position = FArg(1);
if (GamePreferences::m_AutoPlay == PC_REPLAY) {
p->m_fReplayBookmarkSeconds = position;
return 1;
return 0;
}
return 0;
}
Expand All @@ -3025,7 +3018,7 @@ class LunaScreenGameplay : public Luna<ScreenGameplay>
if (GamePreferences::m_AutoPlay == PC_REPLAY &&
GAMESTATE->GetPaused()) {
p->SetSongPosition(p->m_fReplayBookmarkSeconds);
return 1;
return 0;
}
return 0;
}
Expand Down

0 comments on commit 893cb47

Please sign in to comment.