mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-18 17:46:42 +00:00
Misc::NotNullPtr<MWWorld::ESMStore> to MWWorld::ESMStore& store
This commit is contained in:
parent
6671c12ad2
commit
5d0986e812
1 changed files with 4 additions and 4 deletions
|
@ -97,8 +97,8 @@ namespace MWLua
|
||||||
|
|
||||||
landApi["getTextureAt"] = [lua = lua](const osg::Vec3f& pos, sol::object cellOrName) {
|
landApi["getTextureAt"] = [lua = lua](const osg::Vec3f& pos, sol::object cellOrName) {
|
||||||
sol::variadic_results values;
|
sol::variadic_results values;
|
||||||
Misc::NotNullPtr<MWWorld::ESMStore> store = MWBase::Environment::get().getESMStore();
|
MWWorld::ESMStore& store = *MWBase::Environment::get().getESMStore();
|
||||||
const MWWorld::Store<ESM::Land>& landStore = store->get<ESM::Land>();
|
const MWWorld::Store<ESM::Land>& landStore = store.get<ESM::Land>();
|
||||||
|
|
||||||
const float cellSize = ESM::getCellSize(worldspaceAt(pos, cellOrName));
|
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
|
// We need to read land twice. Once to get the amount of texture samples per cell edge, and the second time
|
||||||
|
@ -131,8 +131,8 @@ namespace MWLua
|
||||||
// Need to check for 0, 0 so that we can safely subtract 1 later, as per documentation on UniqueTextureId
|
// Need to check for 0, 0 so that we can safely subtract 1 later, as per documentation on UniqueTextureId
|
||||||
if (textureId.first != 0)
|
if (textureId.first != 0)
|
||||||
{
|
{
|
||||||
Misc::NotNullPtr<MWWorld::ESMStore> store = MWBase::Environment::get().getESMStore();
|
MWWorld::ESMStore& store = *MWBase::Environment::get().getESMStore();
|
||||||
const MWWorld::Store<ESM::LandTexture>& textureStore = store->get<ESM::LandTexture>();
|
const MWWorld::Store<ESM::LandTexture>& textureStore = store.get<ESM::LandTexture>();
|
||||||
const std::string* textureString = textureStore.search(textureId.first - 1, textureId.second);
|
const std::string* textureString = textureStore.search(textureId.first - 1, textureId.second);
|
||||||
if (!textureString)
|
if (!textureString)
|
||||||
return values;
|
return values;
|
||||||
|
|
Loading…
Reference in a new issue