diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/os/os.cpp | 11 | ||||
-rw-r--r-- | core/variant_op.cpp | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index ee9f12b79d..8caf95e4d1 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -61,9 +61,16 @@ void OS::debug_break() { void OS::print_error(const char* p_function,const char* p_file,int p_line,const char *p_code,const char*p_rationale,ErrorType p_type) { + const char* err_type; + switch(p_type) { + case ERR_ERROR: err_type="**ERROR**"; break; + case ERR_WARNING: err_type="**WARNING**"; break; + case ERR_SCRIPT: err_type="**SCRIPT ERROR**"; break; + } + if (p_rationale && *p_rationale) - print("**ERROR**: %s\n ",p_rationale); - print("**ERROR**: At: %s:%i:%s() - %s\n",p_file,p_line,p_function,p_code); + print("%s: %s\n ",err_type,p_rationale); + print("%s: At: %s:%i:%s() - %s\n",err_type,p_file,p_line,p_function,p_code); } void OS::print(const char* p_format, ...) { diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 39a802e171..eabd647837 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -2587,7 +2587,7 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { String idx=p_index; const String *str=reinterpret_cast<const String*>(_data._mem); - return str->find("idx")!=-1; + return str->find(idx)!=-1; } } break; |