diff options
Diffstat (limited to 'modules/visual_script/visual_script.cpp')
-rw-r--r-- | modules/visual_script/visual_script.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 2b884c34fb..aec60391d3 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -6,6 +6,7 @@ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1072,6 +1073,18 @@ void VisualScript::get_script_property_list(List<PropertyInfo> *p_list) const { } } +int VisualScript::get_member_line(const StringName &p_member) const { +#ifdef TOOLS_ENABLED + if (has_function(p_member)) { + for (Map<int, Function::NodeData>::Element *E = functions[p_member].nodes.front(); E; E = E->next()) { + if (E->get().node->cast_to<VisualScriptFunction>()) + return E->key(); + } + } +#endif + return -1; +} + #ifdef TOOLS_ENABLED bool VisualScript::are_subnodes_edited() const { @@ -1489,7 +1502,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p VSDEBUG("WORKING MEM: " + itos(node->working_mem_idx)); if (current_node_id == f->node) { - //if function node, set up function arguments from begining of stack + //if function node, set up function arguments from beginning of stack for (int i = 0; i < f->argument_count; i++) { input_args[i] = &variant_stack[i]; |