mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-02 22:34:34 +00:00
Retain global script targets without content files
This commit is contained in:
parent
35a9a47eac
commit
cc6145bc0f
1 changed files with 4 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue