@@ -46,7 +46,7 @@ bool MultiplayerSpawner::_set(const StringName &p_name, const Variant &p_value)
4646 if (ns.begins_with (" scenes/" )) {
4747 uint32_t index = ns.get_slicec (' /' , 1 ).to_int ();
4848 ERR_FAIL_UNSIGNED_INDEX_V (index, spawnable_scenes.size (), false );
49- spawnable_scenes[index].path = p_value;
49+ spawnable_scenes[index].path = ResourceUID::ensure_path ( p_value) ;
5050 return true ;
5151 }
5252 }
@@ -62,7 +62,7 @@ bool MultiplayerSpawner::_get(const StringName &p_name, Variant &r_ret) const {
6262 if (ns.begins_with (" scenes/" )) {
6363 uint32_t index = ns.get_slicec (' /' , 1 ).to_int ();
6464 ERR_FAIL_UNSIGNED_INDEX_V (index, spawnable_scenes.size (), false );
65- r_ret = spawnable_scenes[index].path ;
65+ r_ret = ResourceUID::path_to_uid ( spawnable_scenes[index].path ) ;
6666 return true ;
6767 }
6868 }
@@ -97,15 +97,9 @@ PackedStringArray MultiplayerSpawner::get_configuration_warnings() const {
9797
9898void MultiplayerSpawner::add_spawnable_scene (const String &p_path) {
9999 SpawnableScene sc;
100- if (p_path.begins_with (" uid://" )) {
101- sc.uid = p_path;
102- sc.path = ResourceUID::uid_to_path (p_path);
103- } else {
104- sc.uid = ResourceUID::path_to_uid (p_path);
105- sc.path = p_path;
106- }
100+ sc.path = ResourceUID::ensure_path (p_path);
107101 if (Engine::get_singleton ()->is_editor_hint ()) {
108- ERR_FAIL_COND (!ResourceLoader::exists (p_path ));
102+ ERR_FAIL_COND (!ResourceLoader::exists (sc. path ));
109103 }
110104 spawnable_scenes.push_back (sc);
111105#ifdef TOOLS_ENABLED
@@ -145,7 +139,7 @@ Vector<String> MultiplayerSpawner::_get_spawnable_scenes() const {
145139 Vector<String> ss;
146140 ss.resize (spawnable_scenes.size ());
147141 for (int i = 0 ; i < ss.size (); i++) {
148- ss.write [i] = spawnable_scenes[i].uid ;
142+ ss.write [i] = ResourceUID::path_to_uid ( spawnable_scenes[i].path ) ;
149143 }
150144 return ss;
151145}
0 commit comments