Skip to content

Commit

Permalink
defaults.js: send the right number of arguments to input.get callbacks
Browse files Browse the repository at this point in the history
Only send how many arguments were actually passed by console.lua instead
of sending extra undefined arguments.
  • Loading branch information
guidocella authored and sfan5 committed Nov 14, 2024
1 parent ea6b111 commit 1c3f092
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion player/javascript/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1c3f092

Please sign in to comment.