diff --git a/ios/src/AssetManager.cpp b/ios/src/AssetManager.cpp index 5f6ad060..0825fb63 100644 --- a/ios/src/AssetManager.cpp +++ b/ios/src/AssetManager.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -262,7 +263,7 @@ void AssetManager::updateAnimations() { for (auto& asset : _assets) { - vector completed; + std::vector completed; int index = 0; for(auto& anim : asset.mAnimations) { @@ -333,8 +334,9 @@ void AssetManager::updateAnimations() { asset.mAnimator->updateBoneMatrices(); index++; } - for(auto& it : completed) { - asset.mAnimations.erase(asset.mAnimations.begin() + it); + + for(int i = completed.size() - 1; i >= 0; i--) { + asset.mAnimations.erase(asset.mAnimations.begin() + i); } } }