From 1c3f09270f1ea86945a4aea3e4a7be5e2552e877 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Wed, 13 Nov 2024 08:10:55 +0100 Subject: [PATCH] defaults.js: send the right number of arguments to input.get callbacks Only send how many arguments were actually passed by console.lua instead of sending extra undefined arguments. --- player/javascript/defaults.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/javascript/defaults.js b/player/javascript/defaults.js index 538f71cbe78de..57e4b1646b751 100644 --- a/player/javascript/defaults.js +++ b/player/javascript/defaults.js @@ -654,7 +654,7 @@ function register_event_handler(t) { mp.register_script_message("input-event", function (type, args) { if (t[type]) { args = args ? JSON.parse(args) : []; - var result = t[type](args[0], args[1]); + var result = t[type].apply(null, args); if (type == "complete" && result) { mp.commandv("script-message-to", "console", "complete",