From 0bd9506a93078b9c071958d5e1f45aa4c49c864d Mon Sep 17 00:00:00 2001 From: parax0 Date: Wed, 27 Apr 2016 20:40:43 -0600 Subject: [PATCH] Fixed null animations not being cleared out correctly when loading animsets --- src/Core/Resource/Factory/CAnimSetLoader.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/Core/Resource/Factory/CAnimSetLoader.cpp b/src/Core/Resource/Factory/CAnimSetLoader.cpp index c779e667..af15a4c3 100644 --- a/src/Core/Resource/Factory/CAnimSetLoader.cpp +++ b/src/Core/Resource/Factory/CAnimSetLoader.cpp @@ -328,22 +328,18 @@ CAnimSet* CAnimSetLoader::LoadANCS(IInputStream& rANCS) Loader.LoadHalfTransition(rANCS); } - // Remove empty anims - for (auto it = Loader.mAnimPrimitives.begin(); it != Loader.mAnimPrimitives.end(); it++) - { - if (!it->Loaded) - it = Loader.mAnimPrimitives.erase(it); - } - // Add anims to set for (u32 iPrim = 0; iPrim < Loader.mAnimPrimitives.size(); iPrim++) { SPrimitive& rPrim = Loader.mAnimPrimitives[iPrim]; - CAnimSet::SAnimation Anim; - Anim.Name = rPrim.Name; - Anim.pAnim = gResCache.GetResource(rPrim.AnimID, "ANIM"); - Loader.pSet->mAnims.push_back(Anim); + if (rPrim.Loaded) + { + CAnimSet::SAnimation Anim; + Anim.Name = rPrim.Name; + Anim.pAnim = gResCache.GetResource(rPrim.AnimID, "ANIM"); + Loader.pSet->mAnims.push_back(Anim); + } } return Loader.pSet;