Fix delete() not returning sometimes, closes #1067
parent
10fc47476b
commit
319d8e6854
|
@ -71,7 +71,7 @@ bool CObjectManager::DeleteObject(CObject* instance)
|
||||||
it->second.reset();
|
it->second.reset();
|
||||||
m_shouldCleanRemovedObjects = true;
|
m_shouldCleanRemovedObjects = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
} else assert(false);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -657,7 +657,7 @@ bool CScriptFunctions::rDelete(CBotVar* var, CBotVar* result, int& exception, vo
|
||||||
}
|
}
|
||||||
|
|
||||||
CObject* obj = CObjectManager::GetInstancePointer()->GetObjectById(rank);
|
CObject* obj = CObjectManager::GetInstancePointer()->GetObjectById(rank);
|
||||||
if ( obj == nullptr )
|
if ( obj == nullptr || (obj->Implements(ObjectInterfaceType::Old) && dynamic_cast<COldObject*>(obj)->IsDying()) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue