fix subtle bugs that caused inaccurate judgment totals with AI player

This commit is contained in:
Chris Danford
2003-04-10 05:46:31 +00:00
parent 17e9a7d777
commit 04145caf72
20 changed files with 88 additions and 74 deletions
+2 -1
View File
@@ -110,8 +110,9 @@ void Inventory::Update( float fDelta )
if( iLastSecond != iThisSecond )
{
int iSlotToConsider = rand()%NUM_INVENTORY_SLOTS;
bool bTimeToUse = (rand()%10)==0;
if( GAMESTATE->m_sInventory[m_PlayerNumber][iSlotToConsider] != "" &&
rand()%5 == 0 )
bTimeToUse )
{
UseItem( iSlotToConsider );
}
+1 -1
View File
@@ -135,7 +135,7 @@ MusicWheel::MusicWheel()
GAMESTATE->m_pCurSong = pSong;
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( GAMESTATE->IsPlayerEnabled(p) )
if( GAMESTATE->IsHumanPlayer(p) )
{
GAMESTATE->m_pCurNotes[p] = pNotes;
GAMESTATE->m_PlayerOptions[p] = po;
+8 -2
View File
@@ -102,14 +102,20 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore(unsigned row) const
TapNoteScore score = TNS_MARVELOUS;
for( int t=0; t<GetNumTracks(); t++ )
{
/* If there's no tap note on this row, skip it; the score will always be TNS_NONE. */
if(GetTapNote(t, row) == TAP_EMPTY) continue;
/* If there's no tap note on this row, skip it, or else the score will always be TNS_NONE. */
if(GetTapNote(t, row) == TAP_EMPTY)
continue;
score = min( score, GetTapNoteScore(t, row) );
}
return score;
}
bool NoteDataWithScoring::IsRowCompletelyJudged(unsigned row) const
{
return MinTapNoteScore(row) >= TNS_MISS;
}
/* Return the last tap score of a row: the grade of the tap that completed
* the row. If the row has no tap notes, return -1. If any tap notes aren't
* graded (any tap is TNS_NONE) or are missed (TNS_MISS), return it. */
+1
View File
@@ -49,6 +49,7 @@ public:
float GetHoldNoteLife(unsigned h) const;
void SetHoldNoteLife(unsigned h, float f);
bool IsRowCompletelyJudged(unsigned row) const;
TapNoteScore MinTapNoteScore(unsigned row) const;
int LastTapNoteScoreTrack(unsigned row) const;
TapNoteScore LastTapNoteScore(unsigned row) const;
+28 -22
View File
@@ -10,9 +10,9 @@
-----------------------------------------------------------------------------
*/
#include "Player.h"
#include "GameConstantsAndTypes.h"
#include <math.h> // for fabs()
#include "Player.h"
#include "RageUtil.h"
#include "PrefsManager.h"
#include "GameConstantsAndTypes.h"
@@ -195,21 +195,19 @@ void Player::Update( float fDeltaTime )
if( hn.fStartBeat < fSongBeat && fSongBeat < hn.fEndBeat ) // if the song beat is in the range of this hold
{
bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI );
if( GAMESTATE->m_PlayerController[m_PlayerNumber] != HUMAN ) // TODO: Make the CPU miss sometimes.
// TODO: Make the CPU miss sometimes.
if( GAMESTATE->m_PlayerController[m_PlayerNumber] != HUMAN )
bIsHoldingButton = true;
m_NoteField.m_bIsHoldingHoldNote[i] = bIsHoldingButton && bSteppedOnTapNote; // set host flag so NoteField can do intelligent drawing
if( bSteppedOnTapNote ) // this note is not judged and we stepped on its head
{
m_NoteField.GetHoldNote(i).fStartBeat = fSongBeat; // move the start of this Hold
}
if( bSteppedOnTapNote && bIsHoldingButton )
{
// Increase life
// fLife += fDeltaTime/PREFSMAN->m_fJudgeWindowOKSeconds;
// fLife = min( fLife, 1 ); // clamp
fLife = 1;
m_GhostArrowRow.HoldNote( hn.iTrack ); // update the "electric ghost" effect
@@ -240,7 +238,7 @@ void Player::Update( float fDeltaTime )
if( hns != HNS_NONE )
{
/* this note's been judged */
/* this note has been judged */
HandleHoldScore( hns, tns );
m_HoldJudgment[hn.iTrack].SetHoldJudgment( hns );
}
@@ -371,11 +369,23 @@ void Player::Step( int col )
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowGreatSeconds ) score = TNS_GREAT;
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowGoodSeconds ) score = TNS_GOOD;
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowBooSeconds ) score = TNS_BOO;
else score = TNS_NONE;
else
{
// if this step is worse than Boo, we shouldn't be here in the first place.
ASSERT(0);
return;
}
}
else
{
score = PlayerAI::GetTapNoteScore( GAMESTATE->m_PlayerController[m_PlayerNumber], GAMESTATE->GetSumOfActiveAttackLevels(m_PlayerNumber) );
/* AI will generate misses here. Don't handle a miss like a regular note because
* we want the judgment animation to appear delayed. Instead, return early if
* AI generated a miss, and let UpdateMissedTapNotesOlderThan() detect and handle the
* misses. */
if( score == TNS_MISS )
return;
}
if( score==TNS_MARVELOUS && !PREFSMAN->m_bMarvelousTiming )
@@ -387,11 +397,14 @@ void Player::Step( int col )
SetTapNoteScore(col, iIndexOverlappingNote, score);
SetTapNoteOffset(col, iIndexOverlappingNote, -fNoteOffset);
if ( score >= TNS_GREAT )
if( GAMESTATE->m_PlayerController[m_PlayerNumber] == HUMAN &&
score >= TNS_GREAT )
HandleAutosync(fNoteOffset);
if (score > TNS_NONE && MinTapNoteScore(iIndexOverlappingNote) >= TNS_BOO )
OnRowDestroyed( iIndexOverlappingNote );
ASSERT( score != TNS_NONE );
if( IsRowCompletelyJudged(iIndexOverlappingNote) )
OnRowCompletelyJudged( iIndexOverlappingNote );
}
if( !bDestroyedNote )
@@ -420,9 +433,9 @@ void Player::HandleAutosync(float fNoteOffset)
}
void Player::OnRowDestroyed( int iIndexThatWasSteppedOn )
void Player::OnRowCompletelyJudged( int iIndexThatWasSteppedOn )
{
LOG->Trace( "Player::OnRowDestroyed" );
LOG->Trace( "Player::OnRowCompletelyJudged" );
/* Find the minimum score of the row. This will never be TNS_NONE, since this
* function is only called when a row is completed. */
@@ -515,14 +528,9 @@ void Player::CrossedRow( int iNoteRow )
{
// check to see if there's at the crossed row
for( int t=0; t<GetNumTracks(); t++ )
{
if( GetTapNote(t, iNoteRow) != TAP_EMPTY )
{
TapNoteScore tns = PlayerAI::GetTapNoteScore( GAMESTATE->m_PlayerController[m_PlayerNumber], GAMESTATE->GetSumOfActiveAttackLevels(m_PlayerNumber) );
if( tns!=TNS_MISS )
this->Step( t );
}
}
if( GAMESTATE->m_PlayerController[m_PlayerNumber] != HUMAN )
Step( t );
}
@@ -572,8 +580,6 @@ void Player::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore )
if( m_pLifeMeter ) {
m_pLifeMeter->ChangeLife( holdScore, tapScore );
// refresh Oni life meter
m_pLifeMeter->OnDancePointsChange();
}
}
+1 -1
View File
@@ -54,7 +54,7 @@ public:
protected:
void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
void OnRowDestroyed( int iStepIndex );
void OnRowCompletelyJudged( int iStepIndex );
void HandleTapRowScore( unsigned row );
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
void HandleAutosync(float fNoteOffset);
+7 -5
View File
@@ -23,7 +23,7 @@ struct TapScoreDistribution
float fRand = randomf(0,1);
ASSERT( iDifficultyExponent >= 1 );
fRand = powf(fRand, iDifficultyExponent);
for( int i=0; i<NUM_TAP_NOTE_SCORES; i++ )
for( int i=TNS_MISS; i<=TNS_MARVELOUS; i++ )
if( fRand <= fCumulativeProbability[i] )
return (TapNoteScore)i;
ASSERT(0); // the last probability must be 1.0, so we should never get here!
@@ -67,10 +67,10 @@ TapScoreDistribution TAP_SCORE_DISTRIBUTIONS[NUM_PLAYER_CONTROLLERS] =
{
0.00f, // TNS_NONE
0.005f, // TNS_MISS
0.010f, // TNS_BOO
0.03f, // TNS_GOOD
0.007f, // TNS_BOO
0.01f, // TNS_GOOD
0.10f, // TNS_GREAT
0.50f, // TNS_PERFECT
0.60f, // TNS_PERFECT
1.00f, // TNS_MARVELOUS
},
// CPU_AUTOPLAY
@@ -88,5 +88,7 @@ TapScoreDistribution TAP_SCORE_DISTRIBUTIONS[NUM_PLAYER_CONTROLLERS] =
TapNoteScore PlayerAI::GetTapNoteScore( PlayerController pc, int iSumOfAttackLevels )
{
return TAP_SCORE_DISTRIBUTIONS[pc].GetTapNoteScore( iSumOfAttackLevels+1 );
TapNoteScore tns = TAP_SCORE_DISTRIBUTIONS[pc].GetTapNoteScore( iSumOfAttackLevels+1 );
ASSERT( tns != TNS_NONE ); // sanity check on PlayerAI's result
return tns;
}
+1 -1
View File
@@ -114,7 +114,7 @@ void Screen::Input( const DeviceInput& DeviceI, const InputEventType type, const
if( !MenuI.IsValid() )
return;
if( !GAMESTATE->IsPlayerEnabled(MenuI.player) )
if( !GAMESTATE->IsHumanPlayer(MenuI.player) )
return;
switch( MenuI.button )
+3
View File
@@ -29,6 +29,7 @@
#include "NoteSkinManager.h"
#include "Notes.h"
#include <utility>
#include "NoteFieldPositioning.h"
const float RECORD_HOLD_SECONDS = 0.3f;
@@ -271,6 +272,8 @@ ScreenEdit::ScreenEdit()
GAMESTATE->m_PlayerController[PLAYER_1] = HUMAN;
m_Player.SetXY( PLAYER_X, PLAYER_Y );
GAMESTATE->m_Position[PLAYER_1]->LoadFromStyleDef(GAMESTATE->GetCurrentStyleDef(), PLAYER_1);
m_Fade.SetClosed();
m_sprHelp.Load( THEME->GetPathTo("Graphics","ScreenEdit help") );
+9 -9
View File
@@ -189,16 +189,16 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type )
case stage:
{
for( int p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) )
if( GAMESTATE->IsHumanPlayer(p) )
GAMESTATE->m_pCurNotes[p]->AddScore( (PlayerNumber)p, grade[p], stageStats.fScore[p], bNewRecord[p] );
}
break;
case summary:
{
NotesType nt = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
bool bIsPlayerEnabled[NUM_PLAYERS];
bool bIsHumanPlayer[NUM_PLAYERS];
for( p=0; p<NUM_PLAYERS; p++ )
bIsPlayerEnabled[p] = GAMESTATE->IsPlayerEnabled(p);
bIsHumanPlayer[p] = GAMESTATE->IsHumanPlayer(p);
RankingCategory cat[NUM_PLAYERS];
int iRankingIndex[NUM_PLAYERS];
@@ -208,7 +208,7 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type )
cat[p] = AverageMeterToRankingCategory( fAverageMeter );
}
SONGMAN->AddScores( nt, bIsPlayerEnabled, cat, stageStats.fScore, iRankingIndex );
SONGMAN->AddScores( nt, bIsHumanPlayer, cat, stageStats.fScore, iRankingIndex );
COPY( GAMESTATE->m_RankingCategory, cat );
COPY( GAMESTATE->m_iRankingIndex, iRankingIndex );
@@ -218,14 +218,14 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type )
case course:
{
NotesType nt = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
bool bIsPlayerEnabled[NUM_PLAYERS];
bool bIsHumanPlayer[NUM_PLAYERS];
for( p=0; p<NUM_PLAYERS; p++ )
bIsPlayerEnabled[p] = GAMESTATE->IsPlayerEnabled(p);
bIsHumanPlayer[p] = GAMESTATE->IsHumanPlayer(p);
int iRankingIndex[NUM_PLAYERS];
Course* pCourse = GAMESTATE->m_pCurCourse;
pCourse->AddScores( nt, bIsPlayerEnabled, stageStats.iActualDancePoints, stageStats.fAliveSeconds, iRankingIndex, bNewRecord );
pCourse->AddScores( nt, bIsHumanPlayer, stageStats.iActualDancePoints, stageStats.fAliveSeconds, iRankingIndex, bNewRecord );
COPY( GAMESTATE->m_iRankingIndex, iRankingIndex );
GAMESTATE->m_pRankingCourse = pCourse;
GAMESTATE->m_RankingNotesType = nt;
@@ -483,7 +483,7 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type )
case 3: iValue = stageStats.iTapNoteScores[p][TNS_GOOD]; break;
case 4: iValue = stageStats.iTapNoteScores[p][TNS_BOO]; break;
case 5: iValue = stageStats.iTapNoteScores[p][TNS_MISS]; break;
case 6: iValue = stageStats.iTapNoteScores[p][HNS_OK]; break;
case 6: iValue = stageStats.iHoldNoteScores[p][HNS_OK]; break;
case 7: iValue = stageStats.iMaxCombo[p]; break;
default: iValue = 0; ASSERT(0);
}
@@ -829,7 +829,7 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn )
{
bool bOnePassed = false;
for( int p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) )
if( GAMESTATE->IsHumanPlayer(p) )
bOnePassed |= !GAMESTATE->m_CurStageStats.bFailed[p];
if( bOnePassed )
+3 -3
View File
@@ -379,7 +379,7 @@ void ScreenEz2SelectMusic::DrawPrimitives()
void ScreenEz2SelectMusic::EasierDifficulty( PlayerNumber pn )
{
if( !GAMESTATE->IsPlayerEnabled(pn) )
if( !GAMESTATE->IsHumanPlayer(pn) )
return;
if( m_arrayNotes[pn].empty() )
return;
@@ -406,7 +406,7 @@ void ScreenEz2SelectMusic::EasierDifficulty( PlayerNumber pn )
void ScreenEz2SelectMusic::HarderDifficulty( PlayerNumber pn )
{
if( !GAMESTATE->IsPlayerEnabled(pn
if( !GAMESTATE->IsHumanPlayer(pn
) )
return;
if( m_arrayNotes[pn].empty() )
@@ -464,7 +464,7 @@ void ScreenEz2SelectMusic::MusicChanged()
for( pn=0; pn<NUM_PLAYERS; pn++ )
{
if( !GAMESTATE->IsPlayerEnabled( PlayerNumber(pn) ) )
if( !GAMESTATE->IsHumanPlayer( PlayerNumber(pn) ) )
continue;
for( unsigned i=0; i<m_arrayNotes[pn].size(); i++ )
{
+2 -8
View File
@@ -943,16 +943,10 @@ void ScreenGameplay::Update( float fDeltaTime )
int iRowNow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
if( iRowNow >= 0 )
{
for( int r=m_iRowLastCrossed+1; r<=iRowNow; r++ ) // for each index we crossed since the last update
{
for( ; m_iRowLastCrossed <= iRowNow; m_iRowLastCrossed++ ) // for each index we crossed since the last update
for( pn=0; pn<NUM_PLAYERS; pn++ )
{
if( GAMESTATE->IsPlayerEnabled(pn) )
m_Player[pn].CrossedRow( r );
}
}
m_iRowLastCrossed = iRowNow;
m_Player[pn].CrossedRow( m_iRowLastCrossed );
}
if( GAMESTATE->m_SongOptions.m_bAssistTick && IsTimeToPlayTicks())
+1 -1
View File
@@ -47,7 +47,7 @@ ScreenInstructions::ScreenInstructions()
Difficulty easiestDifficulty = (Difficulty)(NUM_DIFFICULTIES-1);
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled(p) )
if( !GAMESTATE->IsHumanPlayer(p) )
continue;
easiestDifficulty = min( easiestDifficulty, GAMESTATE->m_PreferredDifficulty[p] );
}
+2 -2
View File
@@ -144,7 +144,7 @@ ScreenNameEntry::ScreenNameEntry()
// remove modifiers that may have been on the last song
GAMESTATE->m_PlayerOptions[p] = PlayerOptions();
ASSERT( GAMESTATE->IsPlayerEnabled(p) ); // they better be enabled if they made a high score!
ASSERT( GAMESTATE->IsHumanPlayer(p) ); // they better be enabled if they made a high score!
m_GrayArrowRow[p].Load( (PlayerNumber)p );
m_GrayArrowRow[p].SetX( (float)GAMESTATE->GetCurrentStyleDef()->m_iCenterX[p] );
@@ -363,7 +363,7 @@ void ScreenNameEntry::HandleScreenMessage( const ScreenMessage SM )
StageStats stats;
GAMESTATE->GetFinalEvalStatsAndSongs( stats, vSongs );
for( int p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) )
if( GAMESTATE->IsHumanPlayer(p) )
max_grade = max( max_grade, stats.GetGrade((PlayerNumber)p) );
if( max_grade >= GRADE_AA )
SCREENMAN->SetNewScreen( "ScreenCredits" );
+5 -5
View File
@@ -100,7 +100,7 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRow[], int iNumOptionLin
// init highlights and underlines
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled(p) )
if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip
for( int l=0; l<m_iNumOptionRows; l++ )
@@ -226,7 +226,7 @@ void ScreenOptions::InitOptionsText()
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( GAMESTATE->IsPlayerEnabled(p) )
if( GAMESTATE->IsHumanPlayer(p) )
{
BitmapText &option = m_textItems[i][p];
@@ -386,7 +386,7 @@ void ScreenOptions::UpdateEnabledDisabled()
{
bool bThisRowIsSelected = false;
for( int p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) && m_iCurrentRow[p] == i )
if( GAMESTATE->IsHumanPlayer(p) && m_iCurrentRow[p] == i )
bThisRowIsSelected = true;
m_sprBullets[i].SetDiffuse( bThisRowIsSelected ? colorSelected : colorNotSelected );
@@ -403,7 +403,7 @@ void ScreenOptions::UpdateEnabledDisabled()
bool bThisRowIsSelectedByBoth = true;
for( int p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) && m_iCurrentRow[p] != i )
if( GAMESTATE->IsHumanPlayer(p) && m_iCurrentRow[p] != i )
bThisRowIsSelectedByBoth = false;
m_textItems[i][0].SetDiffuse( bThisRowIsSelectedByBoth ? colorNotSelected : colorSelected );
if( bThisRowIsSelectedByBoth )
@@ -511,7 +511,7 @@ void ScreenOptions::MenuStart( PlayerNumber pn )
{
bool bAllOnExit = true;
for( int p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) && m_iCurrentRow[p] != m_iNumOptionRows )
if( GAMESTATE->IsHumanPlayer(p) && m_iCurrentRow[p] != m_iNumOptionRows )
bAllOnExit = false;
if( m_iCurrentRow[pn] != m_iNumOptionRows ) // not on exit
+2 -2
View File
@@ -51,8 +51,8 @@ ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, bool b
m_rectAnswerBox.SetDiffuse( RageColor(0.5f,0.5f,1.0f,0.7f) );
this->AddChild( &m_rectAnswerBox );
m_textAnswer[0].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
m_textAnswer[1].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
m_textAnswer[0].LoadFromFont( THEME->GetPathTo("Fonts","_shared1") );
m_textAnswer[1].LoadFromFont( THEME->GetPathTo("Fonts","_shared1") );
m_textAnswer[0].SetY( PROMPT_Y );
m_textAnswer[1].SetY( PROMPT_Y );
this->AddChild( &m_textAnswer[0] );
+1 -1
View File
@@ -232,7 +232,7 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
case SM_MenuTimer:
{
for( int p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) )
if( GAMESTATE->IsHumanPlayer(p) )
MenuStart( (PlayerNumber)p );
}
break;
+3 -3
View File
@@ -101,7 +101,7 @@ ScreenSelectCourse::ScreenSelectCourse()
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
if( !GAMESTATE->IsHumanPlayer((PlayerNumber)p) )
continue; // skip
m_sprHighScoreFrame[p].Load( THEME->GetPathTo("Graphics","ScreenSelectCourse score frame") );
@@ -211,7 +211,7 @@ void ScreenSelectCourse::Input( const DeviceInput& DeviceI, InputEventType type,
if( MenuI.button == MENU_BUTTON_RIGHT || MenuI.button == MENU_BUTTON_LEFT )
{
if( !MenuI.IsValid() ) return;
if( !GAMESTATE->IsPlayerEnabled(MenuI.player) ) return;
if( !GAMESTATE->IsHumanPlayer(MenuI.player) ) return;
int dir = 0;
if(INPUTMAPPER->IsButtonDown( MenuInput(MenuI.player, MENU_BUTTON_RIGHT) ) )
@@ -432,7 +432,7 @@ void ScreenSelectCourse::UpdateOptionsDisplays()
{
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( GAMESTATE->IsPlayerEnabled(p) )
if( GAMESTATE->IsHumanPlayer(p) )
{
CString s = GAMESTATE->m_PlayerOptions[p].GetString();
s.Replace( ", ", "\n" );
+6 -6
View File
@@ -183,7 +183,7 @@ void ScreenSelectDifficulty::UpdateSelectableChoices()
}
for( int p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) )
if( GAMESTATE->IsHumanPlayer(p) )
{
MenuRight( (PlayerNumber)p );
MenuLeft( (PlayerNumber)p );
@@ -227,7 +227,7 @@ void ScreenSelectDifficulty::ChangePage( Page newPage )
// If anyone has already chosen, don't allow changing of pages
for( p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) && m_bChosen[p] )
if( GAMESTATE->IsHumanPlayer(p) && m_bChosen[p] )
return;
bool bPageIncreasing = newPage > m_CurrentPage;
@@ -257,7 +257,7 @@ void ScreenSelectDifficulty::ChangeWithinPage( PlayerNumber pn, int iNewChoice,
{
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled(p) )
if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip
if( p!=pn && m_CurrentPage==PAGE_1 )
@@ -333,7 +333,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
// check to see if everyone has chosen
for( p=0; p<NUM_PLAYERS; p++ )
{
if( GAMESTATE->IsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false )
if( GAMESTATE->IsHumanPlayer((PlayerNumber)p) && m_bChosen[p] == false )
return;
}
this->PostScreenMessage( SM_BeginFadingOut, SLEEP_AFTER_CHOICE_SECONDS ); // tell our owner it's time to move on
@@ -357,7 +357,7 @@ void ScreenSelectDifficulty::TweenOnScreen()
for( p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
if( !GAMESTATE->IsHumanPlayer((PlayerNumber)p) )
continue;
float fCursorX = GetCursorX( (PlayerNumber)p );
@@ -380,7 +380,7 @@ void ScreenSelectDifficulty::TweenOffScreen()
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
if( !GAMESTATE->IsHumanPlayer((PlayerNumber)p) )
continue;
m_sprCursor[p].Command( CURSOR_OFF_COMMAND );
+2 -1
View File
@@ -81,7 +81,8 @@ Grade StageStats::GetGrade( PlayerNumber pn )
iTapNoteScores[pn][TNS_GREAT] == 0 &&
iTapNoteScores[pn][TNS_GOOD] == 0 &&
iTapNoteScores[pn][TNS_BOO] == 0 &&
iTapNoteScores[pn][TNS_MISS] == 0 )
iTapNoteScores[pn][TNS_MISS] == 0 &&
iHoldNoteScores[pn][HNS_NG] == 0 )
return GRADE_AAAA;
if ( fPercentDancePoints == 1.00 ) return GRADE_AAA;