2
0
Эх сурвалжийг харах

Make sure variant parser recognizes "nil" for compatibility with old engine.cfg style cofig. Closes #3531

Juan Linietsky 9 жил өмнө
parent
commit
b587614653

+ 1 - 1
core/variant_parser.cpp

@@ -542,7 +542,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
 			value=true;
 			value=true;
 		else if (id=="false")
 		else if (id=="false")
 			value=false;
 			value=false;
-		else if (id=="null")
+		else if (id=="null" || id=="nil")
 			value=Variant();
 			value=Variant();
 		else if (id=="Vector2"){
 		else if (id=="Vector2"){
 
 

+ 3 - 1
scene/gui/control.cpp

@@ -1597,7 +1597,9 @@ bool Control::has_focus() const {
 
 
 void Control::grab_focus() {
 void Control::grab_focus() {
 
 
-	ERR_FAIL_COND(!is_inside_tree());
+	if (!is_inside_tree()){
+		ERR_FAIL_COND(!is_inside_tree());
+	}
 	if (data.focus_mode==FOCUS_NONE)
 	if (data.focus_mode==FOCUS_NONE)
 		return;
 		return;