1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:53:52 +00:00

Allow ActionOpen and ActionTalk only for player (bug #5210

This commit is contained in:
Andrei Kortunov 2019-11-18 12:41:11 +04:00
parent a6ffaaa434
commit 4118b20608
4 changed files with 10 additions and 2 deletions

View file

@ -174,6 +174,7 @@
Bug #5196: Dwarven ghosts do not use idle animations Bug #5196: Dwarven ghosts do not use idle animations
Bug #5206: A "class does not have NPC stats" error when player's follower kills an enemy with damage spell Bug #5206: A "class does not have NPC stats" error when player's follower kills an enemy with damage spell
Bug #5209: Spellcasting ignores race height Bug #5209: Spellcasting ignores race height
Bug #5210: AiActivate allows actors to open dialogue and inventory windows
Feature #1774: Handle AvoidNode Feature #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI Feature #2229: Improve pathfinding AI
Feature #3025: Analogue gamepad movement controls Feature #3025: Analogue gamepad movement controls

View file

@ -3,6 +3,7 @@
#include <components/esm/aisequence.hpp> #include <components/esm/aisequence.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
@ -58,7 +59,7 @@ bool AiPursue::execute (const MWWorld::Ptr& actor, CharacterController& characte
if (pathTo(actor, dest, duration, pathTolerance) && if (pathTo(actor, dest, duration, pathTolerance) &&
std::abs(dest.z() - actorPos.z()) < pathTolerance) // check the true distance in case the target is far away in Z-direction std::abs(dest.z() - actorPos.z()) < pathTolerance) // check the true distance in case the target is far away in Z-direction
{ {
target.getClass().activate(target,actor).get()->execute(actor); //Arrest player when reached MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue, actor); //Arrest player when reached
return true; return true;
} }

View file

@ -18,6 +18,9 @@ namespace MWWorld
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
return; return;
if (actor != MWMechanics::getPlayer())
return;
if (!MWBase::Environment::get().getMechanicsManager()->onOpen(getTarget())) if (!MWBase::Environment::get().getMechanicsManager()->onOpen(getTarget()))
return; return;

View file

@ -3,12 +3,15 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp" #include "../mwbase/windowmanager.hpp"
#include "../mwmechanics/actorutil.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().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue, getTarget()); if (actor == MWMechanics::getPlayer())
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue, getTarget());
} }
} }