Fixes a game crash caused by instantiating Camera2D and sending a notification from it before adding it to the tree.
This commit is contained in:
parent
0aa6f27061
commit
eb2deabffe
@ -232,6 +232,7 @@ void Camera2D::_notification(int p_what) {
|
|||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
|
ERR_FAIL_COND(!is_inside_tree());
|
||||||
if (custom_viewport && ObjectDB::get_instance(custom_viewport_id)) {
|
if (custom_viewport && ObjectDB::get_instance(custom_viewport_id)) {
|
||||||
viewport = custom_viewport;
|
viewport = custom_viewport;
|
||||||
} else {
|
} else {
|
||||||
|
@ -274,6 +274,7 @@ void CanvasItem::_exit_canvas() {
|
|||||||
void CanvasItem::_notification(int p_what) {
|
void CanvasItem::_notification(int p_what) {
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
|
ERR_FAIL_COND(!is_inside_tree());
|
||||||
_update_texture_filter_changed(false);
|
_update_texture_filter_changed(false);
|
||||||
_update_texture_repeat_changed(false);
|
_update_texture_repeat_changed(false);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user