mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:56:43 +00:00 
			
		
		
		
	Don't attempt to use broken weapons in AI
This commit is contained in:
		
							parent
							
								
									0bdc1b243a
								
							
						
					
					
						commit
						2e623bac5a
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -102,7 +102,11 @@ namespace MWMechanics
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (item.getClass().hasItemHealth(item))
 | 
					        if (item.getClass().hasItemHealth(item))
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (item.getClass().getItemHealth(item) == 0)
 | 
				
			||||||
 | 
					                return 0.f;
 | 
				
			||||||
            rating *= item.getClass().getItemHealth(item) / float(item.getClass().getItemMaxHealth(item));
 | 
					            rating *= item.getClass().getItemHealth(item) / float(item.getClass().getItemMaxHealth(item));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (weapon->mData.mType == ESM::Weapon::MarksmanBow)
 | 
					        if (weapon->mData.mType == ESM::Weapon::MarksmanBow)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue