From cc6145bc0ffacdbdf4c3d90b2edbc085777dcac2 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sun, 27 Jul 2025 17:12:14 +0200 Subject: [PATCH] Retain global script targets without content files --- apps/openmw/mwscript/globalscripts.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwscript/globalscripts.cpp b/apps/openmw/mwscript/globalscripts.cpp index 6900aea7f7..69806870c0 100644 --- a/apps/openmw/mwscript/globalscripts.cpp +++ b/apps/openmw/mwscript/globalscripts.cpp @@ -26,13 +26,13 @@ namespace script.mRunning = false; if (!ptr.isEmpty()) { - if (ptr.getCellRef().hasContentFile()) + if (MWBase::Environment::get().getWorld()->getPlayerPtr() == ptr) + script.mTargetId = ptr.getCellRef().getRefId(); + else if (ptr.getCellRef().getRefNum().isSet()) { script.mTargetId = ptr.getCellRef().getRefId(); script.mTargetRef = ptr.getCellRef().getRefNum(); } - else if (MWBase::Environment::get().getWorld()->getPlayerPtr() == ptr) - script.mTargetId = ptr.getCellRef().getRefId(); } return script; } @@ -60,7 +60,7 @@ namespace MWWorld::Ptr operator()(const std::pair& pair) const { - if (pair.first.hasContentFile()) + if (pair.first.isSet()) return MWBase::Environment::get().getWorldModel()->getPtr(pair.first); else if (pair.second.empty()) return MWWorld::Ptr();