From 87e41425bb1bb7e6cb9e4fedf801eb4b20cdc4df Mon Sep 17 00:00:00 2001 From: Aussiemon Date: Sun, 13 Jul 2025 02:36:16 -0600 Subject: [PATCH] Unnecessary ptrClass --- apps/openmw/mwscript/interpretercontext.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index dbd139d180..d24420ec91 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -302,8 +302,7 @@ namespace MWScript std::string_view InterpreterContext::getNPCFaction() const { const MWWorld::Ptr& ptr = getReferenceImp(); - const MWWorld::Class& ptrClass = ptr.getClass(); - const ESM::RefId& factionId = ptrClass.getPrimaryFaction(ptr); + const ESM::RefId& factionId = ptr.getClass().getPrimaryFaction(ptr); if (factionId.empty()) { Log(Debug::Warning) << "getNPCFaction(): NPC " << ptr.mRef->mRef.getRefId() << " has no primary faction"; @@ -363,8 +362,7 @@ namespace MWScript std::string_view InterpreterContext::getPCRank() const { const MWWorld::Ptr& ptr = getReferenceImp(); - const MWWorld::Class& ptrClass = ptr.getClass(); - const ESM::RefId& factionId = ptrClass.getPrimaryFaction(ptr); + const ESM::RefId& factionId = ptr.getClass().getPrimaryFaction(ptr); if (factionId.empty()) { Log(Debug::Warning) << "getPCRank(): NPC " << ptr.mRef->mRef.getRefId() << " has no primary faction"; @@ -396,8 +394,7 @@ namespace MWScript std::string_view InterpreterContext::getPCNextRank() const { const MWWorld::Ptr& ptr = getReferenceImp(); - const MWWorld::Class& ptrClass = ptr.getClass(); - const ESM::RefId& factionId = ptrClass.getPrimaryFaction(ptr); + const ESM::RefId& factionId = ptr.getClass().getPrimaryFaction(ptr); if (factionId.empty()) { Log(Debug::Warning) << "getPCNextRank(): NPC " << ptr.mRef->mRef.getRefId() << " has no primary faction";