If either player is enabled, you can use GAMESTATE->m_MasterPlayerNumber to get the
first that joined; do this instead of iterating. Remove redundant check. Style cleanup. Charles, please make an effort to conform to the style of the rest of the codebase; you keep committing stuff in a completely different style and others keep having to clean it up.
This commit is contained in:
@@ -429,18 +429,13 @@ void ScreenGameplay::Init()
|
|||||||
//the following is only used in SMLAN/SMOnline
|
//the following is only used in SMLAN/SMOnline
|
||||||
if( NSMAN->useSMserver )
|
if( NSMAN->useSMserver )
|
||||||
{
|
{
|
||||||
int i=-1;
|
PlayerNumber pn = GAMESTATE->m_MasterPlayerNumber;
|
||||||
FOREACH_PlayerNumber(p)
|
|
||||||
if (!GAMESTATE->IsPlayerEnabled(p))
|
|
||||||
i=p;
|
|
||||||
m_ShowScoreboard=false;
|
|
||||||
if (i!=-1)
|
|
||||||
{
|
|
||||||
FOREACH_NSScoreBoardColumn( i2 )
|
FOREACH_NSScoreBoardColumn( i2 )
|
||||||
{
|
{
|
||||||
m_Scoreboard[i2].LoadFromFont( THEME->GetPathF(m_sName,"scoreboard") );
|
m_Scoreboard[i2].LoadFromFont( THEME->GetPathF(m_sName,"scoreboard") );
|
||||||
m_Scoreboard[i2].SetShadowLength( 0 );
|
m_Scoreboard[i2].SetShadowLength( 0 );
|
||||||
m_Scoreboard[i2].SetName( ssprintf("ScoreboardC%iP%i",i2+1,i+1) );
|
m_Scoreboard[i2].SetName( ssprintf("ScoreboardC%iP%i",i2+1,pn+1) );
|
||||||
SET_XY( m_Scoreboard[i2] );
|
SET_XY( m_Scoreboard[i2] );
|
||||||
this->AddChild( &m_Scoreboard[i2] );
|
this->AddChild( &m_Scoreboard[i2] );
|
||||||
m_Scoreboard[i2].SetText(NSMAN->m_Scoreboard[i2]);
|
m_Scoreboard[i2].SetText(NSMAN->m_Scoreboard[i2]);
|
||||||
@@ -448,7 +443,6 @@ void ScreenGameplay::Init()
|
|||||||
m_ShowScoreboard = true;
|
m_ShowScoreboard = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
m_textSongTitle.LoadFromFont( THEME->GetPathF(m_sName,"song title") );
|
m_textSongTitle.LoadFromFont( THEME->GetPathF(m_sName,"song title") );
|
||||||
m_textSongTitle.SetShadowLength( 0 );
|
m_textSongTitle.SetShadowLength( 0 );
|
||||||
@@ -2324,8 +2318,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
m_soundMusic.Stop();
|
m_soundMusic.Stop();
|
||||||
break;
|
break;
|
||||||
case SM_NET_UpdateScoreboard:
|
case SM_NET_UpdateScoreboard:
|
||||||
if (!NSMAN->useSMserver)
|
|
||||||
break;
|
|
||||||
if( m_ShowScoreboard )
|
if( m_ShowScoreboard )
|
||||||
FOREACH_NSScoreBoardColumn(cn)
|
FOREACH_NSScoreBoardColumn(cn)
|
||||||
if( NSMAN->ChangedScoreboard(cn) )
|
if( NSMAN->ChangedScoreboard(cn) )
|
||||||
|
|||||||
Reference in New Issue
Block a user