@@ -66,12 +66,14 @@ namespace RTE {
66
66
m_TopLevelSoundSet.AddSoundSet (soundSetToAdd);
67
67
} else if (propName == " SoundSelectionCycleMode" || propName == " CycleMode" ) {
68
68
m_TopLevelSoundSet.SetSoundSelectionCycleMode (SoundSet::ReadSoundSelectionCycleMode (reader));
69
- } else if (propName == " OverlapMode" ) {
70
- std::string overlapModeString = reader.ReadPropValue ();
71
- if (c_SoundOverlapModeMap.find (overlapModeString) != c_SoundOverlapModeMap.end ()) {
72
- m_SoundOverlapMode = c_SoundOverlapModeMap.find (overlapModeString)->second ;
69
+ } else if (propName == " SoundOverlapMode" ) {
70
+ std::string soundOverlapModeString = reader.ReadPropValue ();
71
+ if (c_SoundOverlapModeMap.find (soundOverlapModeString) != c_SoundOverlapModeMap.end ()) {
72
+ m_SoundOverlapMode = c_SoundOverlapModeMap.find (soundOverlapModeString)->second ;
73
+ } else if (std::stoi (soundOverlapModeString)) {
74
+ m_SoundOverlapMode = static_cast <SoundOverlapMode>(std::stoi (soundOverlapModeString));
73
75
} else {
74
- reader.ReportError (" Cycle mode " + overlapModeString + " is invalid." );
76
+ reader.ReportError (" Cycle mode " + soundOverlapModeString + " is invalid." );
75
77
}
76
78
} else if (propName == " Immobile" ) {
77
79
reader >> m_Immobile;
@@ -107,7 +109,7 @@ namespace RTE {
107
109
writer.NewProperty (" SoundSelectionCycleMode" );
108
110
SoundSet::SaveSoundSelectionCycleMode (writer, m_TopLevelSoundSet.GetSoundSelectionCycleMode ());
109
111
110
- writer.NewProperty (" OverlapMode " );
112
+ writer.NewProperty (" SoundOverlapMode " );
111
113
std::list<std::pair<const std::string, SoundOverlapMode>>::const_iterator overlapModeMapEntry = std::find_if (c_SoundOverlapModeMap.begin (), c_SoundOverlapModeMap.end (), [&soundOverlapMode = m_SoundOverlapMode](auto element) { return element.second == soundOverlapMode; });
112
114
if (overlapModeMapEntry != c_SoundOverlapModeMap.end ()) {
113
115
writer << overlapModeMapEntry->first ;
0 commit comments