1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00

Don't add custom anim source if it's a default animation but keep the skeleton

This commit is contained in:
Evil Eye 2024-01-01 15:06:32 +01:00
parent 03c791e61a
commit ef4e5b45e3

View File

@ -492,15 +492,11 @@ namespace MWRender
getActorSkeleton(is1stPerson, isFemale, isBeast, isWerewolf), mResourceSystem->getVFS());
std::string smodel = defaultSkeleton;
bool isBase = !isWerewolf;
if (!is1stPerson && !isWerewolf && !mNpc->mModel.empty())
{
// TESCS sometimes writes the default animation nif to the animation subrecord. This harmless (as it
// will match the NPC's race) until the NPC's race is changed. If the player record contains a default
// non-beast race animation and the player selects a beast race in chargen, animations aren't applied
// properly. Morrowind.exe appears to handle an NPC using any of the base animations as not having custom
// animations.
std::string model = Misc::ResourceHelpers::correctMeshPath(mNpc->mModel);
if (!isDefaultActorSkeleton(model))
isBase = isDefaultActorSkeleton(model);
smodel = Misc::ResourceHelpers::correctActorModelPath(model, mResourceSystem->getVFS());
}
@ -511,12 +507,13 @@ namespace MWRender
if (!is1stPerson)
{
const std::string& base = Settings::models().mXbaseanim;
if (smodel != base && !isWerewolf)
if (!isWerewolf)
addAnimSource(base, smodel);
if (smodel != defaultSkeleton && base != defaultSkeleton)
addAnimSource(defaultSkeleton, smodel);
if (!isBase)
addAnimSource(smodel, smodel);
if (!isWerewolf && isBeast && mNpc->mRace.contains("argonian"))
@ -525,9 +522,10 @@ namespace MWRender
else
{
const std::string& base = Settings::models().mXbaseanim1st;
if (smodel != base && !isWerewolf)
if (!isWerewolf)
addAnimSource(base, smodel);
if (!isBase)
addAnimSource(smodel, smodel);
mObjectRoot->setNodeMask(Mask_FirstPerson);