Skip to content

Commit

Permalink
remove -1 diff profile crash assert and replace it with force value set
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Nov 14, 2018
1 parent db436fa commit 2c81ea0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/XMLProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,12 @@ XMLProfile::SaveEttGeneralDataCreateNode(const Profile* profile) const
pGeneralDataNode->AppendChild("SortOrder",
SortOrderToString(profile->m_SortOrder));

ASSERT_M(profile->m_LastDifficulty >= 0,
ssprintf("congrats you just confirmed the cause of a rare "
"non-repdroducible bug. pd: %i",
GAMESTATE->m_pCurSteps[PLAYER_1]->GetDifficulty()));
if (profile->m_LastDifficulty < Difficulty_Invalid)
if (profile->m_LastDifficulty < 0) // force set difficulty to current steps if this is somehow -1 for ??? reasons -mina
pGeneralDataNode->AppendChild(
"LastDifficulty",
DifficultyToString(
GAMESTATE->m_pCurSteps[PLAYER_1]->GetDifficulty()));
else if (profile->m_LastDifficulty < Difficulty_Invalid)
pGeneralDataNode->AppendChild(
"LastDifficulty", DifficultyToString(profile->m_LastDifficulty));
if (profile->m_LastStepsType != StepsType_Invalid)
Expand Down

0 comments on commit 2c81ea0

Please sign in to comment.