From a6a3eca930e198de4d2d2a11eca1466a3ef527ea Mon Sep 17 00:00:00 2001 From: Lukasz Gromanowski Date: Sun, 12 Oct 2014 13:38:41 +0200 Subject: [PATCH] Fixes #1887: Equipped items do not emit sounds Corrected wrong return type of Class::getSound() method. Signed-off-by: Lukasz Gromanowski --- apps/openmw/mwclass/light.cpp | 2 +- apps/openmw/mwclass/light.hpp | 2 +- apps/openmw/mwworld/class.cpp | 2 +- apps/openmw/mwworld/class.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwclass/light.cpp b/apps/openmw/mwclass/light.cpp index b1bbbcf734..7b2d7e132e 100644 --- a/apps/openmw/mwclass/light.cpp +++ b/apps/openmw/mwclass/light.cpp @@ -298,7 +298,7 @@ namespace MWClass state2.mTime = dynamic_cast (*ptr.getRefData().getCustomData()).mTime; } - const std::string& Light::getSound(const MWWorld::Ptr& ptr) const + std::string Light::getSound(const MWWorld::Ptr& ptr) const { return ptr.get()->mBase->mSound; } diff --git a/apps/openmw/mwclass/light.hpp b/apps/openmw/mwclass/light.hpp index 467bfade88..a3b8412611 100644 --- a/apps/openmw/mwclass/light.hpp +++ b/apps/openmw/mwclass/light.hpp @@ -83,7 +83,7 @@ namespace MWClass const; ///< Write additional state from \a ptr into \a state. - virtual const std::string& getSound(const MWWorld::Ptr& ptr) const; + virtual std::string getSound(const MWWorld::Ptr& ptr) const; }; } diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index 981b6bfba1..31e1a926ab 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -421,7 +421,7 @@ namespace MWWorld throw std::runtime_error("this is not a door"); } - const std::string& Class::getSound(const MWWorld::Ptr&) const + std::string Class::getSound(const MWWorld::Ptr&) const { return std::string(); } diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index 2bfd6e8e4c..053eb5133f 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -338,7 +338,7 @@ namespace MWWorld virtual void restock (const MWWorld::Ptr& ptr) const {} /// Returns sound id - virtual const std::string& getSound(const MWWorld::Ptr& ptr) const; + virtual std::string getSound(const MWWorld::Ptr& ptr) const; }; }