mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 01:26:39 +00:00 
			
		
		
		
	Handle case in the editor when actor's bodypart was not found
This commit is contained in:
		
							parent
							
								
									c114e1278e
								
							
						
					
					
						commit
						0065bccf24
					
				
					 1 changed files with 12 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -113,17 +113,22 @@ namespace CSMWorld
 | 
			
		|||
    const std::string ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const
 | 
			
		||||
    {
 | 
			
		||||
        auto it = mParts.find(index);
 | 
			
		||||
        if (it == mParts.end() && mRaceData && mRaceData->handlesPart(index))
 | 
			
		||||
        if (it == mParts.end())
 | 
			
		||||
        {
 | 
			
		||||
            if (mFemale)
 | 
			
		||||
            if (mRaceData && mRaceData->handlesPart(index))
 | 
			
		||||
            {
 | 
			
		||||
                // Note: we should use male parts for females as fallback
 | 
			
		||||
                const std::string femalePart = mRaceData->getFemalePart(index);
 | 
			
		||||
                if (!femalePart.empty())
 | 
			
		||||
                    return femalePart;
 | 
			
		||||
                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 mRaceData->getMalePart(index);
 | 
			
		||||
            return "";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const std::string& partName = it->second.first;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue