diff --git a/apps/openmw/mwlua/soundbindings.cpp b/apps/openmw/mwlua/soundbindings.cpp index 7f3bdc0ecf..9730960c6f 100644 --- a/apps/openmw/mwlua/soundbindings.cpp +++ b/apps/openmw/mwlua/soundbindings.cpp @@ -1,16 +1,15 @@ #include "soundbindings.hpp" -#include "luabindings.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/soundmanager.hpp" -#include "../mwbase/windowmanager.hpp" +#include "../mwbase/world.hpp" + +#include "../mwworld/esmstore.hpp" #include #include #include -#include "../mwworld/esmstore.hpp" - #include "luamanagerimp.hpp" namespace MWLua @@ -161,9 +160,7 @@ namespace MWLua }, []() { return MWBase::Environment::get().getSoundManager()->sayActive(MWWorld::ConstPtr()); }); - // Sound store using SoundStore = MWWorld::Store; - const SoundStore* soundStore = &MWBase::Environment::get().getWorld()->getStore().get(); sol::usertype soundStoreT = lua.new_usertype("ESM3_SoundStore"); soundStoreT[sol::meta_function::to_string] = [](const SoundStore& store) { return "ESM3_SoundStore{" + std::to_string(store.getSize()) + " sounds}"; }; @@ -176,7 +173,7 @@ namespace MWLua soundStoreT[sol::meta_function::pairs] = lua["ipairsForArray"].template get(); soundStoreT[sol::meta_function::ipairs] = lua["ipairsForArray"].template get(); - api["sounds"] = soundStore; + api["sounds"] = &MWBase::Environment::get().getWorld()->getStore().get(); // Sound record auto soundT = lua.new_usertype("ESM3_Sound");