From 7a9b64c6f4823f16cd2f6e6a6de6812578c106d6 Mon Sep 17 00:00:00 2001 From: mrcheko Date: Thu, 12 Dec 2013 16:08:07 +0200 Subject: [PATCH 1/3] bug fix http://bugs.openmw.org/issues/985 --- apps/openmw/mwworld/actiontalk.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/actiontalk.cpp b/apps/openmw/mwworld/actiontalk.cpp index 905497f85b..6b5e274f57 100644 --- a/apps/openmw/mwworld/actiontalk.cpp +++ b/apps/openmw/mwworld/actiontalk.cpp @@ -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); } } From c8bf69b91affbfd4082b24d70854ec15c878d260 Mon Sep 17 00:00:00 2001 From: mrcheko Date: Fri, 13 Dec 2013 19:02:25 +0200 Subject: [PATCH 2/3] Revert "bug fix http://bugs.openmw.org/issues/985" This reverts commit 7a9b64c6f4823f16cd2f6e6a6de6812578c106d6. --- apps/openmw/mwworld/actiontalk.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/openmw/mwworld/actiontalk.cpp b/apps/openmw/mwworld/actiontalk.cpp index 6b5e274f57..905497f85b 100644 --- a/apps/openmw/mwworld/actiontalk.cpp +++ b/apps/openmw/mwworld/actiontalk.cpp @@ -1,23 +1,15 @@ #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) { - 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); + MWBase::Environment::get().getDialogueManager()->startDialogue (getTarget()); } } From 8b3a393a6b1b0a93cc7ac58353cbd197c3aaf346 Mon Sep 17 00:00:00 2001 From: mrcheko Date: Fri, 13 Dec 2013 19:33:01 +0200 Subject: [PATCH 3/3] bug fix at http://bugs.openmw.org/issues/985 --- apps/openmw/mwclass/npc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index e7c10d3c81..5e9801c493 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -711,6 +711,8 @@ namespace MWClass return boost::shared_ptr(new MWWorld::ActionOpen(ptr, true)); if(get(actor).getStance(actor, MWWorld::Class::Sneak)) return boost::shared_ptr(new MWWorld::ActionOpen(ptr)); // stealing + if(get(ptr).getCreatureStats(ptr).isHostile()) + return boost::shared_ptr(new MWWorld::FailedAction("#{sActorInCombat}")); return boost::shared_ptr(new MWWorld::ActionTalk(ptr)); }