[LifeMeterBattery] Added MaxLives metric, which limits the maximum amount of lives. Setting this to 0 will remove the limit.

This commit is contained in:
AJ Kelly
2011-11-28 22:13:30 -06:00
parent 2d3c3628a1
commit aabb060446
4 changed files with 8 additions and 0 deletions
+3
View File
@@ -24,6 +24,7 @@ void LifeMeterBattery::Load( const PlayerState *pPlayerState, PlayerStageStats *
PlayerNumber pn = pPlayerState->m_PlayerNumber;
MIN_SCORE_TO_KEEP_LIFE.Load(sType, "MinScoreToKeepLife");
MAX_LIVES.Load(sType, "MaxLives");
DANGER_THRESHOLD.Load(sType, "DangerThreshold");
SUBTRACT_LIVES.Load(sType, "SubtractLives");
MINES_SUBTRACT_LIVES.Load(sType, "MinesSubtractLives");
@@ -120,6 +121,8 @@ void LifeMeterBattery::AddLives( int iLives )
{
if( iLives <= 0 )
return;
if( MAX_LIVES != 0 && m_iLivesLeft >= MAX_LIVES )
return;
m_iTrailingLivesLeft = m_iLivesLeft;
m_iLivesLeft += iLives;