You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Fix Camera2D crashes
This commit is contained in:
@@ -250,7 +250,7 @@ void Camera2D::_notification(int p_what) {
|
||||
add_to_group(group_name);
|
||||
add_to_group(canvas_group_name);
|
||||
|
||||
if (enabled && !viewport->get_camera_2d()) {
|
||||
if (!Engine::get_singleton()->is_editor_hint() && enabled && !viewport->get_camera_2d()) {
|
||||
make_current();
|
||||
}
|
||||
|
||||
@@ -260,11 +260,11 @@ void Camera2D::_notification(int p_what) {
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
remove_from_group(group_name);
|
||||
remove_from_group(canvas_group_name);
|
||||
if (is_current()) {
|
||||
clear_current();
|
||||
}
|
||||
remove_from_group(group_name);
|
||||
remove_from_group(canvas_group_name);
|
||||
viewport = nullptr;
|
||||
} break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user