summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-11-19 15:20:00 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-11-19 15:20:00 -0600
commitdd0c24bcd35d3f4756ccee52f4d880fb583667f4 (patch)
tree9426f1839beb0e3bc6da33636b6c462c8bdd15aa /modules
parentfd4c29a189e53a1e085df5b9b9a05cac9351b3ef (diff)
parent88b3090745c75c73605df0539377f7320ba9fa44 (diff)
downloadredot-engine-dd0c24bcd35d3f4756ccee52f4d880fb583667f4.tar.gz
Merge pull request #99137 from KoBeWi/uideal_scenario
Handle scene UIDs in MultiplayerSpawner
Diffstat (limited to 'modules')
-rw-r--r--modules/multiplayer/multiplayer_spawner.cpp10
-rw-r--r--modules/multiplayer/multiplayer_spawner.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/modules/multiplayer/multiplayer_spawner.cpp b/modules/multiplayer/multiplayer_spawner.cpp
index 682d20022f..69a7545e51 100644
--- a/modules/multiplayer/multiplayer_spawner.cpp
+++ b/modules/multiplayer/multiplayer_spawner.cpp
@@ -97,7 +97,13 @@ PackedStringArray MultiplayerSpawner::get_configuration_warnings() const {
void MultiplayerSpawner::add_spawnable_scene(const String &p_path) {
SpawnableScene sc;
- sc.path = p_path;
+ if (p_path.begins_with("uid://")) {
+ sc.uid = p_path;
+ sc.path = ResourceUID::uid_to_path(p_path);
+ } else {
+ sc.uid = ResourceUID::path_to_uid(p_path);
+ sc.path = p_path;
+ }
if (Engine::get_singleton()->is_editor_hint()) {
ERR_FAIL_COND(!ResourceLoader::exists(p_path));
}
@@ -139,7 +145,7 @@ Vector<String> MultiplayerSpawner::_get_spawnable_scenes() const {
Vector<String> ss;
ss.resize(spawnable_scenes.size());
for (int i = 0; i < ss.size(); i++) {
- ss.write[i] = spawnable_scenes[i].path;
+ ss.write[i] = spawnable_scenes[i].uid;
}
return ss;
}
diff --git a/modules/multiplayer/multiplayer_spawner.h b/modules/multiplayer/multiplayer_spawner.h
index 0e94b781ea..868efb9e0b 100644
--- a/modules/multiplayer/multiplayer_spawner.h
+++ b/modules/multiplayer/multiplayer_spawner.h
@@ -49,6 +49,7 @@ public:
private:
struct SpawnableScene {
String path;
+ String uid;
Ref<PackedScene> cache;
};