Skip to content

Commit c76e702

Browse files
committed
Merge pull request #105288 from bruvzg/uid_custom_scene
Fix custom scene argument if it's referenced as UID.
2 parents 66c3d0d + 57bb602 commit c76e702

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

main/main.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,11 +3849,12 @@ int Main::start() {
38493849
} else if (E->get().length() && E->get()[0] != '-' && positional_arg.is_empty()) {
38503850
positional_arg = E->get();
38513851

3852-
if (E->get().ends_with(".scn") ||
3853-
E->get().ends_with(".tscn") ||
3854-
E->get().ends_with(".escn") ||
3855-
E->get().ends_with(".res") ||
3856-
E->get().ends_with(".tres")) {
3852+
String scene_path = ResourceUID::ensure_path(E->get());
3853+
if (scene_path.ends_with(".scn") ||
3854+
scene_path.ends_with(".tscn") ||
3855+
scene_path.ends_with(".escn") ||
3856+
scene_path.ends_with(".res") ||
3857+
scene_path.ends_with(".tres")) {
38573858
// Only consider the positional argument to be a scene path if it ends with
38583859
// a file extension associated with Godot scenes. This makes it possible
38593860
// for projects to parse command-line arguments for custom CLI arguments

0 commit comments

Comments
 (0)