Browse Source

Merge pull request #25518 from bojidar-bg/25505-wrong-type-error-message

Fix wrong error messages for invalid arguments when calling functions through call
Rémi Verschelde 6 năm trước cách đây
mục cha
commit
7fcdadadf4
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      modules/gdscript/gdscript_function.cpp

+ 1 - 1
modules/gdscript/gdscript_function.cpp

@@ -1083,7 +1083,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
 						if (argc >= 1) {
 							methodstr = String(*argptrs[0]) + " (via call)";
 							if (err.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) {
-								err.argument -= 1;
+								err.argument += 1;
 							}
 						}
 					} else if (methodstr == "free") {