Repository: godotengine/godot
File: modules/visual_script/editor/visual_script_editor.h (C/C++)

Code before:

	PortAction port_action;
	int port_action_node;
	int port_action_output;
	Vector2 port_action_pos;
	int port_action_new_node;

	bool saved_pos_dirty = false;

	Vector2 mouse_up_position;

	void _port_action_menu(int p_option);

	void connect_data(Ref<VisualScriptNode> vnode_old, Ref<VisualScriptNode> vnode, int new_id);

	NodePath drop_path;
	Node *drop_node = nullptr;
	Vector2 drop_position;
	void _selected_connect_node(const String &p_text, const String &p_category, const bool p_connecting = true);
	void connect_seq(Ref<VisualScriptNode> vnode_old, Ref<VisualScriptNode> vnode_new, int new_id);

	void _cancel_connect_node();
	int _create_new_node_from_name(const String &p_text, const Vector2 &p_point);
	void _selected_new_virtual_method(const String &p_text, const String &p_category, const bool p_connecting);

	int error_line;

	void _node_selected(Node *p_node);
	void _center_on_node(int p_id);

	void _node_filter_changed(const String &p_text);
	void _change_base_type_callback();
	void _change_base_type();
	void _toggle_tool_script();
	void _member_selected();
	void _member_edited();

	void _begin_node_move();
	void _end_node_move();
	void _move_node(int p_id, const Vector2 &p_to);

	void _get_ends(int p_node, const List<VisualScript::SequenceConnection> &p_seqs, const Set<int> &p_selected, Set<int> &r_end_nodes);

	void _node_moved(Vector2 p_from, Vector2 p_to, int p_id);
	void _remove_node(int p_id);
	void _graph_connected(const String &p_from, int p_from_slot, const String &p_to, int p_to_slot);
	void _graph_disconnected(const String &p_from, int p_from_slot, const String &p_to, int p_to_slot);
	void _graph_connect_to_empty(const String &p_from, int p_from_slot, const Vector2 &p_release_pos);

	void _node_ports_changed(int p_id);
	void _node_create();

Review comment (bug):
Based on the code using it in the `.cpp`, it seems -1 would be a better default value (that's what `set_debugger_active` resets it to).

Code after:

	PortAction port_action;
	int port_action_node = 0;
	int port_action_output = 0;
	Vector2 port_action_pos;
	int port_action_new_node = 0;

	bool saved_pos_dirty = false;

	Vector2 mouse_up_position;

	void _port_action_menu(int p_option);

	void connect_data(Ref<VisualScriptNode> vnode_old, Ref<VisualScriptNode> vnode, int new_id);

	NodePath drop_path;
	Node *drop_node = nullptr;
	Vector2 drop_position;
	void _selected_connect_node(const String &p_text, const String &p_category, const bool p_connecting = true);
	void connect_seq(Ref<VisualScriptNode> vnode_old, Ref<VisualScriptNode> vnode_new, int new_id);

	void _cancel_connect_node();
	int _create_new_node_from_name(const String &p_text, const Vector2 &p_point);
	void _selected_new_virtual_method(const String &p_text, const String &p_category, const bool p_connecting);

	int error_line = -1;

	void _node_selected(Node *p_node);
	void _center_on_node(int p_id);

	void _node_filter_changed(const String &p_text);
	void _change_base_type_callback();
	void _change_base_type();
	void _toggle_tool_script();
	void _member_selected();
	void _member_edited();

	void _begin_node_move();
	void _end_node_move();
	void _move_node(int p_id, const Vector2 &p_to);

	void _get_ends(int p_node, const List<VisualScript::SequenceConnection> &p_seqs, const Set<int> &p_selected, Set<int> &r_end_nodes);

	void _node_moved(Vector2 p_from, Vector2 p_to, int p_id);
	void _remove_node(int p_id);
	void _graph_connected(const String &p_from, int p_from_slot, const String &p_to, int p_to_slot);
	void _graph_disconnected(const String &p_from, int p_from_slot, const String &p_to, int p_to_slot);
	void _graph_connect_to_empty(const String &p_from, int p_from_slot, const Vector2 &p_release_pos);

	void _node_ports_changed(int p_id);
	void _node_create();