diff options
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gd_editor.cpp | 3 | ||||
-rw-r--r-- | modules/gdscript/gd_function.cpp | 8 | ||||
-rw-r--r-- | modules/gdscript/gd_functions.cpp | 2 | ||||
-rw-r--r-- | modules/gdscript/gd_script.cpp | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index f8b45af85a..3fa0a38024 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -35,6 +35,7 @@ #ifdef TOOLS_ENABLED #include "editor/editor_file_system.h" #include "editor/editor_settings.h" +#include "engine.h" #endif void GDScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) const { @@ -2371,7 +2372,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base String GDScriptLanguage::_get_indentation() const { #ifdef TOOLS_ENABLED - if (SceneTree::get_singleton()->is_editor_hint()) { + if (Engine::get_singleton()->is_editor_hint()) { bool use_space_indentation = EDITOR_DEF("text_editor/indent/type", 0); if (use_space_indentation) { diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index 4f8fbd6b46..13a7480a36 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -1233,10 +1233,10 @@ int GDFunction::get_default_argument_count() const { return default_arguments.size(); } -int GDFunction::get_default_argument_addr(int p_arg) const { +int GDFunction::get_default_argument_addr(int p_idx) const { - ERR_FAIL_INDEX_V(p_arg, default_arguments.size(), -1); - return default_arguments[p_arg]; + ERR_FAIL_INDEX_V(p_idx, default_arguments.size(), -1); + return default_arguments[p_idx]; } StringName GDFunction::get_name() const { @@ -1507,7 +1507,7 @@ Variant GDFunctionState::resume(const Variant &p_arg) { void GDFunctionState::_bind_methods() { - ClassDB::bind_method(D_METHOD("resume:Variant", "arg"), &GDFunctionState::resume, DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("resume", "arg"), &GDFunctionState::resume, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("is_valid", "extended_check"), &GDFunctionState::is_valid, DEFVAL(false)); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "_signal_callback", &GDFunctionState::_signal_callback, MethodInfo("_signal_callback")); diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index e0681382e0..65f0cbbe7d 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -464,7 +464,7 @@ void GDFunctions::call(Function p_func, const Variant **p_args, int p_arg_count, VALIDATE_ARG_COUNT(1); VALIDATE_ARG_NUM(0); int64_t num = *p_args[0]; - r_ret = nearest_power_of_2(num); + r_ret = next_power_of_2(num); } break; case OBJ_WEAKREF: { VALIDATE_ARG_COUNT(1); diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 9d304c6d34..2d06c0f5d2 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -615,7 +615,7 @@ Error GDScript::reload(bool p_keep_state) { if (basedir != "") basedir = basedir.get_base_dir(); - if (basedir.find("res://") == -1 && basedir.find("user://") == -1) { + if (basedir != "" && basedir.find("res://") == -1 && basedir.find("user://") == -1) { //loading a template, don't parse return OK; } |