Fix ViewportTexture error when viewport is used from a child scene
Fix invalid errors when a separate child scene file contains a viewport and that viewport is used for a texture in the current scene. Fixes #27790.
This commit is contained in:
parent
98e1b730c8
commit
d2637ca950
|
@ -53,17 +53,17 @@
|
|||
#include "servers/physics_2d_server.h"
|
||||
|
||||
void ViewportTexture::setup_local_to_scene() {
|
||||
Node *local_scene = get_local_scene();
|
||||
if (!local_scene) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (vp) {
|
||||
vp->viewport_textures.erase(this);
|
||||
}
|
||||
|
||||
vp = nullptr;
|
||||
|
||||
Node *local_scene = get_local_scene();
|
||||
if (!local_scene) {
|
||||
return;
|
||||
}
|
||||
|
||||
Node *vpn = local_scene->get_node(path);
|
||||
ERR_FAIL_COND_MSG(!vpn, "ViewportTexture: Path to node is invalid.");
|
||||
|
||||
|
|
Loading…
Reference in New Issue