Added option to reopen if the current level is the same. This contributes to stability for batched tests (#4043)
* Added option to reopen if the current level is the same. This contributes to stability for batched tests Signed-off-by: AMZN-AlexOteiza <aljanru@amazon.co.uk> * Addressed PR comments * Addressed PR and cleaned Base level that had an entity by accident Signed-off-by: AMZN-AlexOteiza <aljanru@amazon.co.uk> * Cleaned up params Signed-off-by: AMZN-AlexOteiza <aljanru@amazon.co.uk> * Addressed PR comments
This commit is contained in:
@@ -143,20 +143,11 @@ namespace
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const bool addToMostRecentFileList = false;
|
||||
auto newDocument = CCryEditApp::instance()->OpenDocumentFile(levelPath.toUtf8().data(),
|
||||
addToMostRecentFileList, COpenSameLevelOptions::ReopenLevelIfSame);
|
||||
|
||||
auto previousDocument = GetIEditor()->GetDocument();
|
||||
QString previousPathName = (previousDocument != nullptr) ? previousDocument->GetLevelPathName() : "";
|
||||
auto newDocument = CCryEditApp::instance()->OpenDocumentFile(levelPath.toUtf8().data());
|
||||
|
||||
// the underlying document pointer doesn't change, so we can't check that; use the path name's instead
|
||||
|
||||
bool result = true;
|
||||
if (newDocument == nullptr || newDocument->IsLevelLoadFailed() || (newDocument->GetLevelPathName() == previousPathName))
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
return newDocument != nullptr && !newDocument->IsLevelLoadFailed();
|
||||
}
|
||||
|
||||
bool PyOpenLevelNoPrompt(const char* pLevelName)
|
||||
|
||||
Reference in New Issue
Block a user