In FEditorFileUtils::SaveCurrentLevel, we set the default return code as true (success) before checking validity of the current level or seeing if PromptToCheckoutLevels is successful. If we're unable to check out a file, this function will return true since it never even attempts to save the file. This function is used by the EditorLevelLibrary, returning an unexpected result when used in editor scripts.

Steps to Reproduce
  1. connect to source control
  2. create a level
  3. add the level to source control in some way and save it
  4. check it in
  5. modify in some way so its dirty
  6. print(unreal.EditorLoadingAndSavingUtils.save_current_level())
  7. Hit "cancel" on the window so you don't check anything out
  8. see that True was returned but the level is not saved

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-143891 in the post.

Login to Vote

ComponentUE - World Creation - Worldbuilding Tools
Affects Versions4.275.0
Target Fix5.5
CreatedFeb 25, 2022
UpdatedFeb 13, 2024