summaryrefslogtreecommitdiff
path: root/scene/gui/check_box.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/check_box.cpp')
-rw-r--r--scene/gui/check_box.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp
index 1381d6eb60..c9803bc654 100644
--- a/scene/gui/check_box.cpp
+++ b/scene/gui/check_box.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -56,14 +56,8 @@ void CheckBox::_notification(int p_what) {
bool CheckBox::is_radio()
{
- Node* parent = this;
- do {
- parent = parent->get_parent();
- if (parent->cast_to<ButtonGroup>())
- break;
- } while (parent);
- return (parent != 0);
+ return get_button_group().is_valid();
}
CheckBox::CheckBox(const String &p_text):