NEVERHOOD: Handle sound 3 when deleting a sound group (bug #12930)

It's consistent with how sounds 1 and 2 are handled, and seems to fix
bug #12930, where the game can crash on exit otherwise.
This commit is contained in:
Torbjörn Andersson 2021-09-29 11:29:30 +02:00 committed by Filippos Karapetis
parent 8ef63e0e0d
commit 912f9b7cef

View File

@ -421,6 +421,11 @@ void SoundMan::deleteSoundGroup(uint32 groupNameHash) {
_soundIndex2 = -1;
}
if (_soundIndex3 != -1 && _soundItems[_soundIndex3]->getGroupNameHash() == groupNameHash) {
deleteSoundByIndex(_soundIndex3);
_soundIndex3 = -1;
}
for (uint index = 0; index < _soundItems.size(); ++index)
if (_soundItems[index] && _soundItems[index]->getGroupNameHash() == groupNameHash)
deleteSoundByIndex(index);