diff options
author | Lopuska <[email protected]> | 2019-09-15 02:09:05 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-15 02:09:05 +0200 |
commit | 0023614da545b2d1a7cecd730e80177e37e8ba9e (patch) | |
tree | a4446aabb29a7e63cfb820049a47b60952353efa /al/auxeffectslot.cpp | |
parent | 4e8caea97e7164b53fca31802cad7e1160930ae5 (diff) |
pass proper effects slot number to AddActiveEffectSlots
It resolves wrong logic when creating more than 1 aux slot at time in a batch
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r-- | al/auxeffectslot.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index b765887c..df35c533 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -280,7 +280,8 @@ START_API_FUNC else { al::vector<ALuint> ids; - ids.reserve(static_cast<ALuint>(n)); + ALsizei count{n}; + ids.reserve(static_cast<ALuint>(count)); do { ALeffectslot *slot{AllocEffectSlot(context.get())}; if(!slot) @@ -290,7 +291,7 @@ START_API_FUNC return; } ids.emplace_back(slot->id); - } while(--n); + } while(--count); std::copy(ids.cbegin(), ids.cend(), effectslots); } |