diff --git a/apps/openmw/mwrender/objectpaging.cpp b/apps/openmw/mwrender/objectpaging.cpp index db81027d9b..b23f079888 100644 --- a/apps/openmw/mwrender/objectpaging.cpp +++ b/apps/openmw/mwrender/objectpaging.cpp @@ -510,8 +510,8 @@ namespace MWRender continue; } - if (ref.mRefID == "prisonmarker" || ref.mRefID == "divinemarker" || ref.mRefID == "templemarker" || ref.mRefID == "northmarker") - continue; // marker objects that have a hardcoded function in the game logic, should be hidden from the player + if (Misc::ResourceHelpers::isHiddenMarker(ref.mRefID)) + continue; int type = store.findStatic(ref.mRefID); std::string model = getModel(type, ref.mRefID, store); diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 3de4940a37..d1b06131b9 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -94,14 +94,12 @@ namespace std::string getModel(const MWWorld::Ptr &ptr, const VFS::Manager *vfs) { + if (Misc::ResourceHelpers::isHiddenMarker(ptr.getCellRef().getRefId())) + return {}; bool useAnim = ptr.getClass().useAnim(); std::string model = ptr.getClass().getModel(ptr); if (useAnim) model = Misc::ResourceHelpers::correctActorModelPath(model, vfs); - - const std::string &id = ptr.getCellRef().getRefId(); - if (id == "prisonmarker" || id == "divinemarker" || id == "templemarker" || id == "northmarker") - model = ""; // marker objects that have a hardcoded function in the game logic, should be hidden from the player return model; } diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp index 5cf4378b85..4d54baafc6 100644 --- a/components/misc/resourcehelpers.cpp +++ b/components/misc/resourcehelpers.cpp @@ -1,6 +1,7 @@ #include "resourcehelpers.hpp" #include +#include #include @@ -138,3 +139,8 @@ std::string Misc::ResourceHelpers::correctActorModelPath(const std::string &resP } return mdlname; } + +bool Misc::ResourceHelpers::isHiddenMarker(std::string_view id) +{ + return id == "prisonmarker" || id == "divinemarker" || id == "templemarker" || id == "northmarker"; +} diff --git a/components/misc/resourcehelpers.hpp b/components/misc/resourcehelpers.hpp index fa50cce228..9e87954e9d 100644 --- a/components/misc/resourcehelpers.hpp +++ b/components/misc/resourcehelpers.hpp @@ -2,6 +2,7 @@ #define MISC_RESOURCEHELPERS_H #include +#include namespace VFS { @@ -23,6 +24,9 @@ namespace Misc std::string correctBookartPath(const std::string &resPath, int width, int height, const VFS::Manager* vfs); /// Use "xfoo.nif" instead of "foo.nif" if available std::string correctActorModelPath(const std::string &resPath, const VFS::Manager* vfs); + + /// marker objects that have a hardcoded function in the game logic, should be hidden from the player + bool isHiddenMarker(std::string_view id); } }