From d7d7abf0577c67f0542228075e365cd081ddfdbe Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Wed, 28 Jul 2021 15:54:45 +0100 Subject: [PATCH] Portals - fix autolink portals to detect internal Although explicit portals did a check to detect internal portals, this check was missing from autolinked portals. This meant they were incorrectly clipping the room bounds of the enclosing outer room. This PR adds a check for internal rooms during the autolinking and sets the internal flag where needed. --- scene/3d/room_manager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/3d/room_manager.cpp b/scene/3d/room_manager.cpp index 40ee256d51..4f9be0a59e 100644 --- a/scene/3d/room_manager.cpp +++ b/scene/3d/room_manager.cpp @@ -924,6 +924,10 @@ void RoomManager::_autolink_portals(Spatial *p_roomlist, LocalVector & // send complete link to visual server so the portal will be active in the visual server room system VisualServer::get_singleton()->portal_link(portal->_portal_rid, source_room->_room_rid, room->_room_rid, portal->_settings_two_way); + // make the portal internal if necessary + // (this prevents the portal plane clipping the room bound) + portal->_internal = source_room->_room_priority > room->_room_priority; + autolink_found = true; break; }