瀏覽代碼

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 年之前
父節點
當前提交
7fcdadadf4
共有 1 個文件被更改,包括 1 次插入1 次删除
  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") {