1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-02 23:34:31 +00:00

Retain global script targets without content files

This commit is contained in:
Evil Eye 2025-07-27 17:12:14 +02:00
parent 35a9a47eac
commit cc6145bc0f

View file

@ -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<ESM::RefNum, ESM::RefId>& 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();