Check for UIDs in MultiplayerSpawner

This commit is contained in:
Summersay415 2024-08-16 22:57:55 +07:00
parent 96be44c0ec
commit b1efaf9666
1 changed files with 3 additions and 1 deletions

View File

@ -31,6 +31,7 @@
#include "multiplayer_spawner.h" #include "multiplayer_spawner.h"
#include "core/io/marshalls.h" #include "core/io/marshalls.h"
#include "core/io/resource_uid.h"
#include "scene/main/multiplayer_api.h" #include "scene/main/multiplayer_api.h"
#include "scene/main/window.h" #include "scene/main/window.h"
@ -276,8 +277,9 @@ void MultiplayerSpawner::_node_exit(ObjectID p_id) {
} }
int MultiplayerSpawner::find_spawnable_scene_index_from_path(const String &p_scene) const { int MultiplayerSpawner::find_spawnable_scene_index_from_path(const String &p_scene) const {
ResourceUID *resource_uid = ResourceUID::get_singleton();
for (uint32_t i = 0; i < spawnable_scenes.size(); i++) { for (uint32_t i = 0; i < spawnable_scenes.size(); i++) {
if (spawnable_scenes[i].path == p_scene) { if (spawnable_scenes[i].path == p_scene || resource_uid->get_id_path(resource_uid->text_to_id(spawnable_scenes[i].path)) == p_scene) {
return i; return i;
} }
} }