1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00

Remove script access to deleted references that have no content file

In original MW these objects are permanently deleted and can not be accessed anymore.
This commit is contained in:
scrawl 2014-12-07 22:37:50 +01:00
parent f49fde3d5d
commit 9f90a1e44b

View File

@ -27,7 +27,9 @@ namespace MWWorld
LiveRef *find (const std::string& name)
{
for (typename List::iterator iter (mList.begin()); iter!=mList.end(); ++iter)
if (iter->mRef.getRefId() == name)
if (!iter->mData.isDeletedByContentFile()
&& (iter->mRef.getRefNum().mContentFile != -1 || iter->mData.getCount() > 0)
&& iter->mRef.getRefId() == name)
return &*iter;
return 0;