mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	Expell player from faction when committing a crime against a faction member
This commit is contained in:
		
							parent
							
								
									19d63f392f
								
							
						
					
					
						commit
						9baa1bef78
					
				
					 2 changed files with 13 additions and 1 deletions
				
			
		|  | @ -255,7 +255,7 @@ namespace MWGui | |||
|             if (pickpocket.finish()) | ||||
|             { | ||||
|                 MWBase::Environment::get().getMechanicsManager()->reportCrime( | ||||
|                             player, MWWorld::Ptr(), MWBase::MechanicsManager::OT_Pickpocket); | ||||
|                             player, mPtr, MWBase::MechanicsManager::OT_Pickpocket); | ||||
|                 MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container); | ||||
|                 MWBase::Environment::get().getDialogueManager()->say(mPtr, "Thief"); | ||||
|                 mPickpocketDetected = true; | ||||
|  |  | |||
|  | @ -829,6 +829,18 @@ namespace MWMechanics | |||
|         ptr.getClass().getNpcStats(ptr).setBounty(ptr.getClass().getNpcStats(ptr).getBounty() | ||||
|                                                   + arg); | ||||
| 
 | ||||
|         // If committing a crime against a faction member, expell from the faction
 | ||||
|         if (!victim.isEmpty() && victim.getClass().isNpc()) | ||||
|         { | ||||
|             std::string factionID; | ||||
|             if(!victim.getClass().getNpcStats(victim).getFactionRanks().empty()) | ||||
|                 factionID = victim.getClass().getNpcStats(victim).getFactionRanks().begin()->first; | ||||
|             if (ptr.getClass().getNpcStats(ptr).isSameFaction(victim.getClass().getNpcStats(victim))) | ||||
|             { | ||||
|                 ptr.getClass().getNpcStats(ptr).expell(factionID); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         // TODO: make any guards in the area try to arrest the player
 | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue