Skip to content

Commit

Permalink
Fix when setup files are not present during first run
Browse files Browse the repository at this point in the history
  • Loading branch information
h3rb authored Jun 7, 2022
1 parent 29ce533 commit 69e960c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/InputCandy/InputCandy.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
InputCandy for GMS 2.3.1+
Tested in Runtime 2022.5.0.8
Always get the latest version from https://github.com/LAGameStudio/InputCandy
See LICENSE for usage guidelines.
Expand Down Expand Up @@ -2804,12 +2805,12 @@ function New_InputCandy_Private() {
// Activate Setup applies device swapping, settings, call on "Frame 5", and only then.
ActivateSetup: function() {
for ( var i=0; i<__INPUTCANDY.max_players; i++ ) {
if ( !__ICI.Is_Valid_Setting(__INPUTCANDY.setup.settings[i]) ) {
if ( array_length(__INPUTCANDY.setup.settings) < (i+1) || !__ICI.Is_Valid_Setting(__INPUTCANDY.setup.settings[i]) ) {
__INPUTCANDY.players[i].settings=none;
if ( !__ICI.Is_Valid_Device(__INPUTCANDY.setup.devices[i]) ) __INPUTCANDY.players[i].device=none;
if ( array_length(__INPUTCANDY.setup.devices) < (i+1) || !__ICI.Is_Valid_Device(__INPUTCANDY.setup.devices[i]) ) __INPUTCANDY.players[i].device=none;
continue;
}
if ( !__ICI.Is_Valid_Device(__INPUTCANDY.setup.devices[i]) ) {
if ( array_length(__INPUTCANDY.setup.devices) < (i+1) || !__ICI.Is_Valid_Device(__INPUTCANDY.setup.devices[i]) ) {
__INPUTCANDY.players[i].device=none;
continue;
}
Expand Down

0 comments on commit 69e960c

Please sign in to comment.