Merge pull request #52338 from lawnjelly/portals_fix_portal_import

Portals - fix import of portal normal + small bug fixes
This commit is contained in:
Rémi Verschelde
2021-09-14 10:21:44 +02:00
committed by GitHub
3 changed files with 40 additions and 17 deletions

View File

@@ -873,7 +873,14 @@ void RoomManager::_second_pass_portals(Spatial *p_roomlist, LocalVector<Portal *
String string_link_room = string_link_room_shortname + "-room";
if (string_link_room_shortname != "") {
// try the room name plus the postfix first, this will be the most common case during import
Room *linked_room = Object::cast_to<Room>(p_roomlist->find_node(string_link_room, true, false));
// try the short name as a last ditch attempt
if (!linked_room) {
linked_room = Object::cast_to<Room>(p_roomlist->find_node(string_link_room_shortname, true, false));
}
if (linked_room) {
NodePath path = portal->get_path_to(linked_room);
portal->set_linked_room_internal(path);