mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:56:39 +00:00 
			
		
		
		
	Fix skill progress not working
This commit is contained in:
		
							parent
							
								
									cd06b2177d
								
							
						
					
					
						commit
						73268a8606
					
				
					 3 changed files with 14 additions and 2 deletions
				
			
		|  | @ -185,7 +185,7 @@ namespace MWGui | |||
|         MyGUI::TextBox* widget = mSkillWidgetMap[(int)parSkill]; | ||||
|         if (widget) | ||||
|         { | ||||
|             float modified = value.getModified(), base = value.getBase(); | ||||
|             int modified = value.getModified(), base = value.getBase(); | ||||
|             std::string text = boost::lexical_cast<std::string>(std::floor(modified)); | ||||
|             std::string state = "normal"; | ||||
|             if (modified > base) | ||||
|  |  | |||
|  | @ -207,7 +207,7 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_, | |||
|     if(mIsWerewolf) | ||||
|         return; | ||||
| 
 | ||||
|     MWMechanics::SkillValue value = getSkill (skillIndex); | ||||
|     MWMechanics::SkillValue& value = getSkill (skillIndex); | ||||
| 
 | ||||
|     value.setProgress(value.getProgress() + getSkillGain (skillIndex, class_, usageType)); | ||||
| 
 | ||||
|  |  | |||
|  | @ -246,6 +246,18 @@ namespace MWMechanics | |||
|     { | ||||
|         return !(left == right); | ||||
|     } | ||||
| 
 | ||||
|     inline bool operator== (const SkillValue& left, const SkillValue& right) | ||||
|     { | ||||
|         return left.getBase() == right.getBase() | ||||
|                 && left.getModifier() == right.getModifier() | ||||
|                 && left.getDamage() == right.getDamage() | ||||
|                 && left.getProgress() == right.getProgress(); | ||||
|     } | ||||
|     inline bool operator!= (const SkillValue& left, const SkillValue& right) | ||||
|     { | ||||
|         return !(left == right); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue