From d3d8d8929f93b75ac8f697141982654a36552ed0 Mon Sep 17 00:00:00 2001 From: DualMatrix Date: Sun, 16 Sep 2018 21:27:54 +0200 Subject: [PATCH] Fixed argument names being swapped for atan2 The arguments of atan2() should be y,x instead of x,y This was just wrong since the internal atan2 already had y,x as parameters, so if you followed the autocomplete the result would just be wrong. --- visual_script_builtin_funcs.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/visual_script_builtin_funcs.cpp b/visual_script_builtin_funcs.cpp index e7a4e0c..60bc54a 100644 --- a/visual_script_builtin_funcs.cpp +++ b/visual_script_builtin_funcs.cpp @@ -260,7 +260,12 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_SQRT: { return PropertyInfo(Variant::REAL, "s"); } break; - case MATH_ATAN2: + case MATH_ATAN2: { + if (p_idx == 0) + return PropertyInfo(Variant::REAL, "y"); + else + return PropertyInfo(Variant::REAL, "x"); + } break; case MATH_FMOD: case MATH_FPOSMOD: { if (p_idx == 0)