1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 09:23:53 +00:00

Use single implementation to check whether marker is hidden

This commit is contained in:
elsid 2022-07-05 00:36:27 +02:00
parent cec7f1e7bc
commit 4613840914
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625
2 changed files with 6 additions and 3 deletions

View file

@ -2,6 +2,8 @@
#include "types/types.hpp"
#include <components/misc/resourcehelpers.hpp>
namespace MWLua
{
@ -12,8 +14,7 @@ namespace MWLua
bool isMarker(const MWWorld::Ptr& ptr)
{
std::string_view id = ptr.getCellRef().getRefId();
return id == "prisonmarker" || id == "divinemarker" || id == "templemarker" || id == "northmarker";
return Misc::ResourceHelpers::isHiddenMarker(ptr.getCellRef().getRefId());
}
std::string ptrToString(const MWWorld::Ptr& ptr)

View file

@ -7,6 +7,8 @@
#include <string_view>
#include <sstream>
#include <components/misc/resourcehelpers.hpp>
#include "livecellref.hpp"
namespace MWWorld
@ -58,7 +60,7 @@ namespace MWWorld
std::string_view id = mRef->mRef.getRefId();
if (id == "player")
return ESM::REC_INTERNAL_PLAYER;
else if (id == "prisonmarker" || id == "divinemarker" || id == "templemarker" || id == "northmarker")
else if (Misc::ResourceHelpers::isHiddenMarker(id))
return ESM::REC_INTERNAL_MARKER;
else
return mRef->getType();