diff --git a/apps/openmw/mwlua/landbindings.cpp b/apps/openmw/mwlua/landbindings.cpp index aef7ab47c6..1e49db5c5e 100644 --- a/apps/openmw/mwlua/landbindings.cpp +++ b/apps/openmw/mwlua/landbindings.cpp @@ -65,7 +65,7 @@ namespace MWLua landApi["getTextureAt"] = [lua = lua](const osg::Vec3f& pos, sol::object cellOrName) { sol::variadic_results values; auto store = MWBase::Environment::get().getESMStore(); - auto landStore = store->get(); + const auto &landStore = store->get(); const float cellSize = ESM::getCellSize(worldspaceAt(pos, cellOrName)); // We need to read land twice. Once to get the amount of texture samples per cell edge, and the second time @@ -100,7 +100,7 @@ namespace MWLua if (textureId.first != 0) { auto store = MWBase::Environment::get().getESMStore(); - auto textureStore = store->get(); + const auto& textureStore = store->get(); const std::string* textureString = textureStore.search(textureId.first - 1, textureId.second); if (textureString) values.push_back(sol::make_object(lua, *textureString));