Portals - fix adding statics twice
Due to an oversight in the autoplace recursive search for static objects, static objects were getting added twice to the portal renderer, which meant they were being rendered twice, lowering performance. This PR corrects this horrendous error.
This commit is contained in:
parent
883bb2f4f6
commit
c2dd51a85e
1 changed files with 6 additions and 0 deletions
|
@ -1141,6 +1141,12 @@ void RoomManager::_autoplace_recursive(Spatial *p_node) {
|
|||
return;
|
||||
}
|
||||
|
||||
// as soon as we hit a room, quit the recursion as the objects
|
||||
// will already have been added inside rooms
|
||||
if (Object::cast_to<Room>(p_node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
VisualInstance *vi = Object::cast_to<VisualInstance>(p_node);
|
||||
|
||||
// we are only interested in VIs with static or dynamic mode
|
||||
|
|
Loading…
Reference in a new issue