From 3c154eb93b3a098354bf6d18a9428826ec193f90 Mon Sep 17 00:00:00 2001 From: qarmin Date: Mon, 1 Jul 2019 12:59:42 +0200 Subject: Remove unnecessary code and add some error explanations --- modules/gdscript/gdscript.cpp | 2 +- modules/gdscript/gdscript_compiler.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/gdscript') diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 95f3c12806..bc28f7009e 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -332,7 +332,7 @@ ScriptInstance *GDScript::instance_create(Object *p_this) { } Variant::CallError unchecked_error; - return _create_instance(NULL, 0, p_this, Object::cast_to(p_this), unchecked_error); + return _create_instance(NULL, 0, p_this, Object::cast_to(p_this) != NULL, unchecked_error); } PlaceHolderScriptInstance *GDScript::placeholder_instance_create(Object *p_this) { diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index caffe04700..4c976bd2e0 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -1259,8 +1259,6 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser:: ERR_FAIL_V(-1); //unreachable code } break; } - - ERR_FAIL_V(-1); //unreachable code } Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::BlockNode *p_block, int p_stack_level, int p_break_addr, int p_continue_addr) { -- cgit v1.2.3