mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
do not add duplicate sounds to the sab files
This commit is contained in:
parent
03340cc109
commit
d807743447
@ -46,7 +46,17 @@ public:
|
||||
|
||||
void AddSound(const std::string& soundFilePath, unsigned int soundId, bool looping, bool streamed) override
|
||||
{
|
||||
this->m_sounds.emplace_back(soundFilePath, soundId, looping, streamed);
|
||||
auto itr = std::find_if(this->m_sounds.begin(),
|
||||
this->m_sounds.end(),
|
||||
[soundId](SoundBankEntryInfo& entry)
|
||||
{
|
||||
return entry.m_sound_id == soundId;
|
||||
});
|
||||
|
||||
if (itr == this->m_sounds.end())
|
||||
{
|
||||
this->m_sounds.emplace_back(soundFilePath, soundId, looping, streamed);
|
||||
}
|
||||
}
|
||||
|
||||
void GoTo(const int64_t offset)
|
||||
|
Loading…
x
Reference in New Issue
Block a user