mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-25 11:26:37 +00:00 
			
		
		
		
	Allow opposite gender's parts as fallback (Fixes #1404)
This commit is contained in:
		
							parent
							
								
									c36decb855
								
							
						
					
					
						commit
						d442853b3e
					
				
					 1 changed files with 14 additions and 2 deletions
				
			
		|  | @ -408,8 +408,6 @@ void NpcAnimation::updateParts() | |||
|             if (bodypart.mData.mType != ESM::BodyPart::MT_Skin) | ||||
|                 continue; | ||||
| 
 | ||||
|             if (!mNpc->isMale() != (bodypart.mData.mFlags & ESM::BodyPart::BPF_Female)) | ||||
|                 continue; | ||||
|             if (!Misc::StringUtils::ciEqual(bodypart.mRace, mNpc->mRace)) | ||||
|                 continue; | ||||
| 
 | ||||
|  | @ -435,6 +433,20 @@ void NpcAnimation::updateParts() | |||
|                 } | ||||
|                 continue; | ||||
|             } | ||||
| 
 | ||||
|             if (!mNpc->isMale() != (bodypart.mData.mFlags & ESM::BodyPart::BPF_Female)) | ||||
|             { | ||||
|                 // Allow opposite gender's parts as fallback if parts for our gender are missing
 | ||||
|                 BodyPartMapType::const_iterator bIt = sBodyPartMap.lower_bound(BodyPartMapType::key_type(bodypart.mData.mPart)); | ||||
|                 while(bIt != sBodyPartMap.end() && bIt->first == bodypart.mData.mPart) | ||||
|                 { | ||||
|                     if(!parts[bIt->second]) | ||||
|                         parts[bIt->second] = &*it; | ||||
|                     ++bIt; | ||||
|                 } | ||||
|                 continue; | ||||
|             } | ||||
| 
 | ||||
|             BodyPartMapType::const_iterator bIt = sBodyPartMap.lower_bound(BodyPartMapType::key_type(bodypart.mData.mPart)); | ||||
|             while(bIt != sBodyPartMap.end() && bIt->first == bodypart.mData.mPart) | ||||
|             { | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue