2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-02 06:57:26 +00:00

Merge pull request #125 from skiff/main

do not add duplicate sounds to the sab files
This commit is contained in:
Jan
2024-02-24 13:38:11 +01:00
committed by GitHub

View File

@@ -45,9 +45,19 @@ public:
} }
void AddSound(const std::string& soundFilePath, unsigned int soundId, bool looping, bool streamed) override void AddSound(const std::string& soundFilePath, unsigned int soundId, bool looping, bool streamed) override
{
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); this->m_sounds.emplace_back(soundFilePath, soundId, looping, streamed);
} }
}
void GoTo(const int64_t offset) void GoTo(const int64_t offset)
{ {