Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 05e1cef

Browse files
committed
Fixed up some dumdum issues with SelectNextSounds, and updated method comments
1 parent 90c10bb commit 05e1cef

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Entities/SoundSet.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ namespace RTE {
224224

225225
bool SoundSet::SelectNextSounds() {
226226
if (m_SoundSelectionCycleMode == SoundSelectionCycleMode::ALL) {
227+
for (SoundSet &subSoundSet : m_SubSoundSets) {
228+
if (!subSoundSet.SelectNextSounds()) {
229+
return false;
230+
}
231+
}
227232
return true;
228233
}
229234
int selectedVectorSize = m_CurrentSelection.first == false ? m_SoundData.size() : m_SubSoundSets.size();
@@ -265,7 +270,6 @@ namespace RTE {
265270
return false;
266271
case 1:
267272
if (selectedVectorSize == 0) { m_CurrentSelection.first = !m_CurrentSelection.first; }
268-
return true;
269273
case 2:
270274
selectSoundForwards();
271275
break;
@@ -283,6 +287,9 @@ namespace RTE {
283287
}
284288
RTEAssert(m_CurrentSelection.second >= 0 && m_CurrentSelection.second < selectedVectorSize, "Failed to select next sound, either none was selected or the selected sound was invalid.");
285289
}
290+
if (m_CurrentSelection.first == true) {
291+
return m_SubSoundSets[m_CurrentSelection.second].SelectNextSounds();
292+
}
286293
return true;
287294
}
288295
}

Entities/SoundSet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ namespace RTE {
175175

176176
#pragma region Miscellaneous
177177
/// <summary>
178-
/// Selects the next sounds of this SoundContainer to be played.
178+
/// Selects the next sounds of this SoundSet to be played, also selecting them for sub SoundSets as appropriate.
179179
/// </summary>
180-
/// <returns>Whether a new sound set was successfully selected.</returns>
180+
/// <returns>False if this SoundSet or any of its sub SoundSets failed to select sounds, or true if everything worked.</returns>
181181
bool SelectNextSounds();
182182
#pragma endregion
183183

0 commit comments

Comments
 (0)