2010-08-06 16:15:46 +00:00
|
|
|
|
|
|
|
#include "actiontalk.hpp"
|
|
|
|
|
2013-12-12 14:08:07 +00:00
|
|
|
#include "class.hpp"
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
#include "../mwbase/environment.hpp"
|
2012-08-09 08:35:53 +00:00
|
|
|
#include "../mwbase/dialoguemanager.hpp"
|
2010-08-06 16:15:46 +00:00
|
|
|
|
2013-12-12 14:08:07 +00:00
|
|
|
#include "../mwmechanics/creaturestats.hpp"
|
|
|
|
|
2010-08-06 16:15:46 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
2012-09-04 13:38:21 +00:00
|
|
|
ActionTalk::ActionTalk (const Ptr& actor) : Action (false, actor) {}
|
2010-08-06 16:15:46 +00:00
|
|
|
|
2012-07-27 10:00:10 +00:00
|
|
|
void ActionTalk::executeImp (const Ptr& actor)
|
2010-08-06 16:15:46 +00:00
|
|
|
{
|
2013-12-12 14:08:07 +00:00
|
|
|
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);
|
2010-08-06 16:15:46 +00:00
|
|
|
}
|
|
|
|
}
|