Skip to content

Commit

Permalink
Fix to CurrentSetup crash issue
Browse files Browse the repository at this point in the history
  • Loading branch information
h3rb authored Jun 18, 2024
1 parent dc374f6 commit b2992d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/InputCandy/InputCandy.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2769,14 +2769,16 @@ function New_InputCandy_Private() {
deviceInfo: []
};
},

// Since setup is driven by the current state, we create an IC setup from the existing configuration.
CurrentSetup: function() {
var setup=__ICI.New_ICSetup();
var setup=global.IC.internal.New_ICSetup();
for ( var i=0; i<__INPUTCANDY.max_players; i++ ) {
setup.devices[array_length(setup.devices)]=__INPUTCANDY.players[i].device;
setup.settings[array_length(setup.settings)]=__INPUTCANDY.players[i].settings;
if ( __INPUTCANDY.players[i].device == none ) setup.deviceInfo[array_length(setup.deviceInfo)]=none;
if ( __INPUTCANDY.players[i].device == none
or __INPUTCANDY.players[i].device < array_length(__INPUTCANDY.devices) )
setup.deviceInfo[array_length(setup.deviceInfo)]=none;
else setup.deviceInfo[array_length(setup.deviceInfo)]=__INPUTCANDY.devices[__INPUTCANDY.players[i].device];
}
return setup;
Expand Down

0 comments on commit b2992d2

Please sign in to comment.