mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:56:43 +00:00 
			
		
		
		
	Closes #1072: Fix extra light being added multiple times when showCarriedLeft(true) is called repeatedly
This commit is contained in:
		
							parent
							
								
									e6c0e187bc
								
							
						
					
					
						commit
						0990ca4b75
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -664,11 +664,12 @@ void NpcAnimation::showCarriedLeft(bool show)
 | 
			
		|||
    {
 | 
			
		||||
        Ogre::Vector3 glowColor = getEnchantmentColor(*iter);
 | 
			
		||||
        std::string mesh = MWWorld::Class::get(*iter).getModel(*iter);
 | 
			
		||||
        addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1,
 | 
			
		||||
                                   mesh, !iter->getClass().getEnchantment(*iter).empty(), &glowColor);
 | 
			
		||||
 | 
			
		||||
        if (iter->getTypeName() == typeid(ESM::Light).name())
 | 
			
		||||
            addExtraLight(mInsert->getCreator(), mObjectParts[ESM::PRT_Shield], iter->get<ESM::Light>()->mBase);
 | 
			
		||||
        if (addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1,
 | 
			
		||||
                                   mesh, !iter->getClass().getEnchantment(*iter).empty(), &glowColor))
 | 
			
		||||
        {
 | 
			
		||||
            if (iter->getTypeName() == typeid(ESM::Light).name())
 | 
			
		||||
                addExtraLight(mInsert->getCreator(), mObjectParts[ESM::PRT_Shield], iter->get<ESM::Light>()->mBase);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
        removeIndividualPart(ESM::PRT_Shield);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue