Browse Source

Properly show the source:line even in inner clases, closes #3766

Juan Linietsky 9 years ago
parent
commit
3754f6cd75
2 changed files with 2 additions and 1 deletions
  1. 1 1
      modules/gdscript/gd_editor.cpp
  2. 1 0
      modules/gdscript/gd_function.h

+ 1 - 1
modules/gdscript/gd_editor.cpp

@@ -212,7 +212,7 @@ String GDScriptLanguage::debug_get_stack_level_source(int p_level) const {
 
 
     ERR_FAIL_INDEX_V(p_level,_debug_call_stack_pos,"");
     ERR_FAIL_INDEX_V(p_level,_debug_call_stack_pos,"");
     int l = _debug_call_stack_pos - p_level -1;
     int l = _debug_call_stack_pos - p_level -1;
-    return _call_stack[l].function->get_script()->get_path();
+    return _call_stack[l].function->get_source();
 
 
 }
 }
 void GDScriptLanguage::debug_get_stack_level_locals(int p_level,List<String> *p_locals, List<Variant> *p_values, int p_max_subitems,int p_max_depth) {
 void GDScriptLanguage::debug_get_stack_level_locals(int p_level,List<String> *p_locals, List<Variant> *p_values, int p_max_subitems,int p_max_depth) {

+ 1 - 0
modules/gdscript/gd_function.h

@@ -160,6 +160,7 @@ public:
 	int get_default_argument_count() const;
 	int get_default_argument_count() const;
 	int get_default_argument_addr(int p_idx) const;
 	int get_default_argument_addr(int p_idx) const;
 	GDScript *get_script() const { return _script; }
 	GDScript *get_script() const { return _script; }
+	StringName get_source() const { return source; }
 
 
 	void debug_get_stack_member_state(int p_line,List<Pair<StringName,int> > *r_stackvars) const;
 	void debug_get_stack_member_state(int p_line,List<Pair<StringName,int> > *r_stackvars) const;