diff --git a/CHANGELOG.md b/CHANGELOG.md index d14b45e90..3a1a3396e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Bug #4720: Inventory avatar has shield with two-handed weapon during [un]equipping animation Bug #4723: ResetActors command works incorrectly Bug #4745: Editor: Interior cell lighting field values are not displayed as colors + Bug #4736: LandTexture records overrides do not work Bug #4746: Non-solid player can't run or sneak Bug #4747: Bones are not read from X.NIF file for NPC animation Bug #4750: Sneaking doesn't work in first person view if the player is in attack ready state diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 79d9174ed..2a0c39466 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -387,6 +387,21 @@ namespace MWWorld assert(plugin < mStatic.size()); + // Replace texture for records with given ID and index from all plugins. + for (unsigned int i=0; i(search(lt.mIndex, i)); + if (tex) + { + const std::string texId = Misc::StringUtils::lowerCase(tex->mId); + const std::string ltId = Misc::StringUtils::lowerCase(lt.mId); + if (texId == ltId) + { + tex->mTexture = lt.mTexture; + } + } + } + LandTextureList <exl = mStatic[plugin]; if(lt.mIndex + 1 > (int)ltexl.size()) ltexl.resize(lt.mIndex+1); diff --git a/components/esm/loadltex.hpp b/components/esm/loadltex.hpp index 1604e9281..e3e258246 100644 --- a/components/esm/loadltex.hpp +++ b/components/esm/loadltex.hpp @@ -11,18 +11,9 @@ class ESMWriter; /* * Texture used for texturing landscape. - * - * They are probably indexed by 'num', not 'id', but I don't know for - * sure. And num is not unique between files, so one option is to keep - * a separate list for each input file (that has LTEX records, of - * course.) We also need to resolve references to already existing - * land textures to save space. - - * I'm not sure if it is even possible to override existing land - * textures, probably not. I'll have to try it, and have to mimic the - * behaviour of morrowind. First, check what you are allowed to do in - * the editor. Then make an esp which changes a commonly used land - * texture, and see if it affects the game. + * They are indexed by 'num', but still use 'id' to override base records. + * Original editor even does not allow to create new records with existing ID's. + * TODO: currently OpenMW-CS does not allow to override LTEX records at all. */ struct LandTexture