Procházet zdrojové kódy

Fix wrong error messages for invalid arguments when calling functions through call

Fixes #25505
Bojidar Marinov před 6 roky
rodič
revize
d2e43475b5
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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) {
 						if (argc >= 1) {
 							methodstr = String(*argptrs[0]) + " (via call)";
 							methodstr = String(*argptrs[0]) + " (via call)";
 							if (err.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) {
 							if (err.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) {
-								err.argument -= 1;
+								err.argument += 1;
 							}
 							}
 						}
 						}
 					} else if (methodstr == "free") {
 					} else if (methodstr == "free") {