Merge pull request #22165 from DualMatrix/atan2_plain_wrong

Fixed argument names having wrong order for atan2
This commit is contained in:
Rémi Verschelde 2018-09-17 12:33:26 +02:00 committed by GitHub
commit 4075c80ea9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -1458,7 +1458,7 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
return mi; return mi;
} break; } break;
case MATH_ATAN2: { case MATH_ATAN2: {
MethodInfo mi("atan2", PropertyInfo(Variant::REAL, "x"), PropertyInfo(Variant::REAL, "y")); MethodInfo mi("atan2", PropertyInfo(Variant::REAL, "y"), PropertyInfo(Variant::REAL, "x"));
mi.return_val.type = Variant::REAL; mi.return_val.type = Variant::REAL;
return mi; return mi;
} break; } break;

View file

@ -260,7 +260,12 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
case MATH_SQRT: { case MATH_SQRT: {
return PropertyInfo(Variant::REAL, "s"); return PropertyInfo(Variant::REAL, "s");
} break; } 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_FMOD:
case MATH_FPOSMOD: { case MATH_FPOSMOD: {
if (p_idx == 0) if (p_idx == 0)