From cb9bb92b26b25a1a29917dc3d845f62c9b3306a9 Mon Sep 17 00:00:00 2001 From: Allofich Date: Wed, 10 Aug 2016 21:02:17 +0900 Subject: [PATCH] Play locked sounds on locked objects instead of actors --- apps/openmw/mwclass/container.cpp | 2 +- apps/openmw/mwclass/door.cpp | 2 +- apps/openmw/mwworld/failedaction.cpp | 4 ++-- apps/openmw/mwworld/failedaction.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 09891652a..47e24f0d6 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -190,7 +190,7 @@ namespace MWClass } else { - boost::shared_ptr action(new MWWorld::FailedAction); + boost::shared_ptr action(new MWWorld::FailedAction(std::string(), ptr)); action->setSound(lockedSound); return action; } diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 8ed6bdca8..99d4a6011 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -220,7 +220,7 @@ namespace MWClass else { // locked, and we can't open. - boost::shared_ptr action(new MWWorld::FailedAction); + boost::shared_ptr action(new MWWorld::FailedAction(std::string(), ptr)); action->setSound(lockedSound); return action; } diff --git a/apps/openmw/mwworld/failedaction.cpp b/apps/openmw/mwworld/failedaction.cpp index 49ca9dae0..45df75a32 100644 --- a/apps/openmw/mwworld/failedaction.cpp +++ b/apps/openmw/mwworld/failedaction.cpp @@ -8,8 +8,8 @@ namespace MWWorld { - FailedAction::FailedAction(const std::string &msg) - : Action(false), mMessage(msg) + FailedAction::FailedAction(const std::string &msg, const Ptr& target) + : Action(false, target), mMessage(msg) { } void FailedAction::executeImp(const Ptr &actor) diff --git a/apps/openmw/mwworld/failedaction.hpp b/apps/openmw/mwworld/failedaction.hpp index f248ee3bd..bafbb6f2d 100644 --- a/apps/openmw/mwworld/failedaction.hpp +++ b/apps/openmw/mwworld/failedaction.hpp @@ -13,7 +13,7 @@ namespace MWWorld virtual void executeImp(const Ptr &actor); public: - FailedAction(const std::string &message = std::string()); + FailedAction(const std::string &message = std::string(), const Ptr& target = Ptr()); }; }