From a2a7b51d1b8787743bb222d89ab74cf8c37cc4a1 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 20 Mar 2004 17:53:04 +0000 Subject: [PATCH] GameState::PlayerUsingBothSides --- stepmania/src/GameState.cpp | 12 ++++++------ stepmania/src/GameState.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 93ec1cd150..ed6202503c 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -653,6 +653,11 @@ int GameState::GetNumPlayersEnabled() const return count; } +bool GameState::PlayerUsingBothSides() const +{ + return this->GetCurrentStyleDef()->m_StyleType==StyleDef::ONE_PLAYER_TWO_CREDITS; +} + bool GameState::IsHumanPlayer( PlayerNumber pn ) const { if( m_CurStyle == STYLE_INVALID ) // no style chosen @@ -1502,12 +1507,7 @@ LuaFunction_NoArgs( IsExtraStage2, GAMESTATE->IsExtraStage2() ) LuaFunction_NoArgs( CourseSongIndex, GAMESTATE->GetCourseSongIndex() ) LuaFunction_NoArgs( CurStyle, GAMESTATE->m_CurStyle ) LuaFunction_NoArgs( GetNumPlayersEnabled, GAMESTATE->GetNumPlayersEnabled() ) - -static bool PlayerUsingBothSides() -{ - return GAMESTATE->GetCurrentStyleDef()->m_StyleType==StyleDef::ONE_PLAYER_TWO_CREDITS; -} -LuaFunction_NoArgs( PlayerUsingBothSides, PlayerUsingBothSides() ) +LuaFunction_NoArgs( PlayerUsingBothSides, GAMESTATE->PlayerUsingBothSides() ) /* Return an integer into SONGMAN->m_pSongs. This lets us do input checking, which we * can't easily do if we return pointers. */ diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index 0046fe618e..f4f77dbb4d 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -73,6 +73,7 @@ public: bool IsPlayerEnabled( PlayerNumber pn ) const; bool IsPlayerEnabled( int p ) const { return IsPlayerEnabled( (PlayerNumber)p ); }; int GetNumPlayersEnabled() const; + bool PlayerUsingBothSides() const; bool IsHumanPlayer( PlayerNumber pn ) const; bool IsHumanPlayer( int p ) const { return IsHumanPlayer( (PlayerNumber)p ); };