1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-18 13:12:50 +00:00

Use male bodyparts as fallback for females in the editor

This commit is contained in:
Andrei Kortunov 2018-09-27 13:14:34 +04:00
parent 7eb1b14b21
commit ac848b0902
2 changed files with 11 additions and 3 deletions

View File

@ -110,11 +110,19 @@ namespace CSMWorld
return SceneUtil::getActorSkeleton(firstPerson, mFemale, beast, werewolf);
}
const std::string& ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const
const std::string ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const
{
if (mParts[index].empty() && mRaceData && mRaceData->handlesPart(index))
{
return mFemale ? mRaceData->getFemalePart(index) : mRaceData->getMalePart(index);
if (mFemale)
{
// Note: we should use male parts for females as fallback
const std::string femalePart = mRaceData->getFemalePart(index);
if (!femalePart.empty())
return femalePart;
}
return mRaceData->getMalePart(index);
}
return mParts[index];
}

View File

@ -88,7 +88,7 @@ namespace CSMWorld
/// Returns the skeleton the actor should use for attaching parts to
std::string getSkeleton() const;
/// Retrieves the associated actor part
const std::string& getPart(ESM::PartReferenceType index) const;
const std::string getPart(ESM::PartReferenceType index) const;
/// Checks if the actor has a data dependency
bool hasDependency(const std::string& id) const;