Change ForceOtherPlayersToCompatibleSteps to treat NULL steps as a failed match.

This commit is contained in:
Kyzentun Keeslala
2015-05-20 23:22:51 -06:00
parent cc2e166c18
commit c155ccffbc
+4 -6
View File
@@ -1084,7 +1084,7 @@ void GameState::ForceOtherPlayersToCompatibleSteps(PlayerNumber main)
FOREACH_EnabledPlayer(pn) FOREACH_EnabledPlayer(pn)
{ {
Trail* pn_steps= m_pCurTrail[pn].Get(); Trail* pn_steps= m_pCurTrail[pn].Get();
bool match_failed= false; bool match_failed= pn_steps == NULL;
if(steps_to_match != pn_steps && pn_steps != NULL) if(steps_to_match != pn_steps && pn_steps != NULL)
{ {
StyleType pn_styletype= GAMEMAN->GetFirstCompatibleStyle( StyleType pn_styletype= GAMEMAN->GetFirstCompatibleStyle(
@@ -1095,14 +1095,13 @@ void GameState::ForceOtherPlayersToCompatibleSteps(PlayerNumber main)
{ {
match_failed= true; match_failed= true;
} }
}
if(match_failed) if(match_failed)
{ {
m_pCurTrail[pn].Set(steps_to_match); m_pCurTrail[pn].Set(steps_to_match);
} }
} }
} }
}
else else
{ {
Steps* steps_to_match= m_pCurSteps[main].Get(); Steps* steps_to_match= m_pCurSteps[main].Get();
@@ -1115,7 +1114,7 @@ void GameState::ForceOtherPlayersToCompatibleSteps(PlayerNumber main)
FOREACH_EnabledPlayer(pn) FOREACH_EnabledPlayer(pn)
{ {
Steps* pn_steps= m_pCurSteps[pn].Get(); Steps* pn_steps= m_pCurSteps[pn].Get();
bool match_failed= false; bool match_failed= pn_steps == NULL;
if(steps_to_match != pn_steps && pn_steps != NULL) if(steps_to_match != pn_steps && pn_steps != NULL)
{ {
StyleType pn_styletype= GAMEMAN->GetFirstCompatibleStyle( StyleType pn_styletype= GAMEMAN->GetFirstCompatibleStyle(
@@ -1130,7 +1129,7 @@ void GameState::ForceOtherPlayersToCompatibleSteps(PlayerNumber main)
{ {
match_failed= true; match_failed= true;
} }
}
if(match_failed) if(match_failed)
{ {
m_pCurSteps[pn].Set(steps_to_match); m_pCurSteps[pn].Set(steps_to_match);
@@ -1138,7 +1137,6 @@ void GameState::ForceOtherPlayersToCompatibleSteps(PlayerNumber main)
} }
} }
} }
}
void GameState::Update( float fDelta ) void GameState::Update( float fDelta )
{ {