easier troubleshooting
This commit is contained in:
@@ -22,7 +22,7 @@ struct TapScoreDistribution
|
|||||||
if( fRand <= fCumulativePercent+1e-4 ) /* rounding error */
|
if( fRand <= fCumulativePercent+1e-4 ) /* rounding error */
|
||||||
return (TapNoteScore)i;
|
return (TapNoteScore)i;
|
||||||
}
|
}
|
||||||
ASSERT(0); // the fCumulativePercents must sum to 1.0, so we should never get here!
|
ASSERT_M( 0, ssprintf("%f,%f",fRand,fCumulativePercent) ); // the fCumulativePercents must sum to 1.0, so we should never get here!
|
||||||
return TNS_W1;
|
return TNS_W1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,8 +33,11 @@ static TapScoreDistribution g_Distributions[NUM_SKILL_LEVELS];
|
|||||||
|
|
||||||
void PlayerAI::InitFromDisk()
|
void PlayerAI::InitFromDisk()
|
||||||
{
|
{
|
||||||
|
bool bSuccess;
|
||||||
|
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.ReadFile( AI_PATH );
|
bSuccess = ini.ReadFile( AI_PATH );
|
||||||
|
ASSERT( bSuccess );
|
||||||
|
|
||||||
for( int i=0; i<NUM_SKILL_LEVELS; i++ )
|
for( int i=0; i<NUM_SKILL_LEVELS; i++ )
|
||||||
{
|
{
|
||||||
@@ -45,12 +48,18 @@ void PlayerAI::InitFromDisk()
|
|||||||
|
|
||||||
TapScoreDistribution& dist = g_Distributions[i];
|
TapScoreDistribution& dist = g_Distributions[i];
|
||||||
dist.fPercent[TNS_None] = 0;
|
dist.fPercent[TNS_None] = 0;
|
||||||
pNode->GetAttrValue( "WeightMiss", dist.fPercent[TNS_Miss] );
|
bSuccess = pNode->GetAttrValue( "WeightMiss", dist.fPercent[TNS_Miss] );
|
||||||
pNode->GetAttrValue( "WeightW5", dist.fPercent[TNS_W5] );
|
ASSERT( bSuccess );
|
||||||
pNode->GetAttrValue( "WeightW4", dist.fPercent[TNS_W4] );
|
bSuccess = pNode->GetAttrValue( "WeightW5", dist.fPercent[TNS_W5] );
|
||||||
pNode->GetAttrValue( "WeightW3", dist.fPercent[TNS_W3] );
|
ASSERT( bSuccess );
|
||||||
pNode->GetAttrValue( "WeightW2", dist.fPercent[TNS_W2] );
|
bSuccess = pNode->GetAttrValue( "WeightW4", dist.fPercent[TNS_W4] );
|
||||||
pNode->GetAttrValue( "WeightW1", dist.fPercent[TNS_W1] );
|
ASSERT( bSuccess );
|
||||||
|
bSuccess = pNode->GetAttrValue( "WeightW3", dist.fPercent[TNS_W3] );
|
||||||
|
ASSERT( bSuccess );
|
||||||
|
bSuccess = pNode->GetAttrValue( "WeightW2", dist.fPercent[TNS_W2] );
|
||||||
|
ASSERT( bSuccess );
|
||||||
|
bSuccess = pNode->GetAttrValue( "WeightW1", dist.fPercent[TNS_W1] );
|
||||||
|
ASSERT( bSuccess );
|
||||||
|
|
||||||
float fSum = 0;
|
float fSum = 0;
|
||||||
for( int j=0; j<NUM_TapNoteScore; j++ )
|
for( int j=0; j<NUM_TapNoteScore; j++ )
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
const T& GetValue() const
|
const T& GetValue() const
|
||||||
{
|
{
|
||||||
ASSERT( m_sName != "" );
|
ASSERT( m_sName != "" );
|
||||||
ASSERT( m_bIsLoaded );
|
ASSERT_M( m_bIsLoaded, m_sGroup + " " + m_sName );
|
||||||
|
|
||||||
if( m_bAlwaysReload )
|
if( m_bAlwaysReload )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user