Skip to content

Commit

Permalink
Portals - fix autolink portals to detect internal
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lawnjelly committed Jul 28, 2021
1 parent 8f89153 commit d7d7abf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scene/3d/room_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,10 @@ void RoomManager::_autolink_portals(Spatial *p_roomlist, LocalVector<Portal *> &
// 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;
}
Expand Down

0 comments on commit d7d7abf

Please sign in to comment.