Skip to content

Commit

Permalink
Write out difficulty_invalid for last played diff
Browse files Browse the repository at this point in the history
this fixes erratic crashes when saving the profile due to the last difficulty value somehow becoming null and reading garbage from memory

last played difficulty isn't relevant for the modern 4k meta and even if it were it would be less of a nuisance than crashing randomly, so while this is an inelegant workaround it's not functionally problematic

and hopefully it fixes all garbage difficulty enum crashes not just the single one we could reproduce
  • Loading branch information
MinaciousGrace committed Oct 3, 2017
1 parent 415857e commit 82ca9a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,7 @@ XNode* Profile::SaveEttGeneralDataCreateNode() const {
pGeneralDataNode->AppendChild("CharacterID", m_sCharacterID);
pGeneralDataNode->AppendChild("Guid", m_sGuid);
pGeneralDataNode->AppendChild("SortOrder", SortOrderToString(m_SortOrder));
pGeneralDataNode->AppendChild("LastDifficulty", DifficultyToString(m_LastDifficulty));
pGeneralDataNode->AppendChild("LastDifficulty", DifficultyToString(Difficulty_Invalid));
if (m_LastStepsType != StepsType_Invalid)
pGeneralDataNode->AppendChild("LastStepsType", GAMEMAN->GetStepsTypeInfo(m_LastStepsType).szName);
pGeneralDataNode->AppendChild(m_lastSong.CreateNode());
Expand Down

0 comments on commit 82ca9a0

Please sign in to comment.