mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-29 03:26:38 +00:00 
			
		
		
		
	This commit is contained in:
		
							parent
							
								
									77a2179d1e
								
							
						
					
					
						commit
						7a9b64c6f4
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		|  | @ -1,15 +1,23 @@ | |||
| 
 | ||||
| #include "actiontalk.hpp" | ||||
| 
 | ||||
| #include "class.hpp" | ||||
| 
 | ||||
| #include "../mwbase/environment.hpp" | ||||
| #include "../mwbase/dialoguemanager.hpp" | ||||
| 
 | ||||
| #include "../mwmechanics/creaturestats.hpp" | ||||
| 
 | ||||
| namespace MWWorld | ||||
| { | ||||
|     ActionTalk::ActionTalk (const Ptr& actor) : Action (false, actor) {} | ||||
| 
 | ||||
|     void ActionTalk::executeImp (const Ptr& actor) | ||||
|     { | ||||
|         MWBase::Environment::get().getDialogueManager()->startDialogue (getTarget()); | ||||
|         MWWorld::Ptr talkTo = getTarget();	//because 'actor' is always the player!
 | ||||
|         if ( MWWorld::Class::get(talkTo).getCreatureStats(talkTo).isHostile() ) | ||||
|             return; | ||||
| 
 | ||||
|         MWBase::Environment::get().getDialogueManager()->startDialogue (talkTo); | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue