From 57bb602e3715d5f2d93ee87606f955a143894cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Fri, 11 Apr 2025 21:40:53 +0300 Subject: [PATCH] Fix custom scene argument if it's referenced as UID. --- main/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 25ed1404bee..2e935203ae9 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -3849,11 +3849,12 @@ int Main::start() { } else if (E->get().length() && E->get()[0] != '-' && positional_arg.is_empty()) { positional_arg = E->get(); - if (E->get().ends_with(".scn") || - E->get().ends_with(".tscn") || - E->get().ends_with(".escn") || - E->get().ends_with(".res") || - E->get().ends_with(".tres")) { + String scene_path = ResourceUID::ensure_path(E->get()); + if (scene_path.ends_with(".scn") || + scene_path.ends_with(".tscn") || + scene_path.ends_with(".escn") || + scene_path.ends_with(".res") || + scene_path.ends_with(".tres")) { // Only consider the positional argument to be a scene path if it ends with // a file extension associated with Godot scenes. This makes it possible // for projects to parse command-line arguments for custom CLI arguments