mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 01:26:39 +00:00 
			
		
		
		
	Some additional wrapping for faction rank instructions
This commit is contained in:
		
							parent
							
								
									7f26843dc3
								
							
						
					
					
						commit
						2451eead8a
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -623,7 +623,8 @@ namespace MWScript
 | 
			
		|||
                        MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
 | 
			
		||||
                        if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) != player.getClass().getNpcStats(player).getFactionRanks().end())
 | 
			
		||||
                        {
 | 
			
		||||
                            player.getClass().getNpcStats(player).getFactionRanks()[factionID] = player.getClass().getNpcStats(player).getFactionRanks()[factionID] -1;
 | 
			
		||||
                            player.getClass().getNpcStats(player).getFactionRanks()[factionID] =
 | 
			
		||||
                                    std::max(0, player.getClass().getNpcStats(player).getFactionRanks()[factionID]-1);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			@ -1031,7 +1032,7 @@ namespace MWScript
 | 
			
		|||
                        return;
 | 
			
		||||
 | 
			
		||||
                    std::map<std::string, int>& ranks = ptr.getClass().getNpcStats(ptr).getFactionRanks ();
 | 
			
		||||
                    ranks[factionID] = ranks[factionID]+1;
 | 
			
		||||
                    ranks[factionID] = std::min(9, ranks[factionID]+1);
 | 
			
		||||
                }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1058,7 +1059,7 @@ namespace MWScript
 | 
			
		|||
                        return;
 | 
			
		||||
 | 
			
		||||
                    std::map<std::string, int>& ranks = ptr.getClass().getNpcStats(ptr).getFactionRanks ();
 | 
			
		||||
                    ranks[factionID] = ranks[factionID]-1;
 | 
			
		||||
                    ranks[factionID] = std::max(0, ranks[factionID]-1);
 | 
			
		||||
                }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue