Merge pull request #44661 from AndreaCatania/AndreaCatania-patch-5

Fixes: GDscript min and max are inverted
This commit is contained in:
Rémi Verschelde 2021-01-05 13:42:08 +01:00 committed by GitHub
commit eea3287c2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -291,7 +291,7 @@ struct VariantUtilityFunctions {
Variant ret;
for (int i = 1; i < p_argcount; i++) {
bool valid;
Variant::evaluate(Variant::OP_GREATER, base, *p_args[i], ret, valid);
Variant::evaluate(Variant::OP_LESS, base, *p_args[i], ret, valid);
if (!valid) {
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.expected = base.get_type();
@ -324,7 +324,7 @@ struct VariantUtilityFunctions {
Variant ret;
for (int i = 1; i < p_argcount; i++) {
bool valid;
Variant::evaluate(Variant::OP_LESS, base, *p_args[i], ret, valid);
Variant::evaluate(Variant::OP_GREATER, base, *p_args[i], ret, valid);
if (!valid) {
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.expected = base.get_type();