Fixed null animations not being cleared out correctly when loading animsets
This commit is contained in:
parent
50dcc9cc1a
commit
0bd9506a93
|
@ -328,23 +328,19 @@ CAnimSet* CAnimSetLoader::LoadANCS(IInputStream& rANCS)
|
||||||
Loader.LoadHalfTransition(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
|
// Add anims to set
|
||||||
for (u32 iPrim = 0; iPrim < Loader.mAnimPrimitives.size(); iPrim++)
|
for (u32 iPrim = 0; iPrim < Loader.mAnimPrimitives.size(); iPrim++)
|
||||||
{
|
{
|
||||||
SPrimitive& rPrim = Loader.mAnimPrimitives[iPrim];
|
SPrimitive& rPrim = Loader.mAnimPrimitives[iPrim];
|
||||||
|
|
||||||
|
if (rPrim.Loaded)
|
||||||
|
{
|
||||||
CAnimSet::SAnimation Anim;
|
CAnimSet::SAnimation Anim;
|
||||||
Anim.Name = rPrim.Name;
|
Anim.Name = rPrim.Name;
|
||||||
Anim.pAnim = gResCache.GetResource(rPrim.AnimID, "ANIM");
|
Anim.pAnim = gResCache.GetResource(rPrim.AnimID, "ANIM");
|
||||||
Loader.pSet->mAnims.push_back(Anim);
|
Loader.pSet->mAnims.push_back(Anim);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Loader.pSet;
|
return Loader.pSet;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue