1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 12:35:46 +00:00
This commit is contained in:
mrcheko 2013-12-12 16:08:07 +02:00
parent 77a2179d1e
commit 7a9b64c6f4

View File

@ -1,15 +1,23 @@
#include "actiontalk.hpp" #include "actiontalk.hpp"
#include "class.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/dialoguemanager.hpp" #include "../mwbase/dialoguemanager.hpp"
#include "../mwmechanics/creaturestats.hpp"
namespace MWWorld namespace MWWorld
{ {
ActionTalk::ActionTalk (const Ptr& actor) : Action (false, actor) {} ActionTalk::ActionTalk (const Ptr& actor) : Action (false, actor) {}
void ActionTalk::executeImp (const Ptr& 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);
} }
} }