@@ -1108,7 +1108,7 @@ var LibrarySDL = {
11081108 // since the browser engine handles that for us. Therefore, in JS we just
11091109 // maintain a list of channels and return IDs for them to the SDL consumer.
11101110 allocateChannels ( num ) { // called from Mix_AllocateChannels and init
1111- if ( SDL . numChannels && SDL . numChannels >= num && num != 0 ) return ;
1111+ if ( SDL . numChannels >= num && num != 0 ) return ;
11121112 SDL . numChannels = num ;
11131113 SDL . channels = [ ] ;
11141114 for ( var i = 0 ; i < num ; i ++ ) {
@@ -3506,7 +3506,7 @@ var LibrarySDL = {
35063506 SDL_JoystickGetAxis__proxy : 'sync ',
35073507 SDL_JoystickGetAxis : ( joystick , axis ) => {
35083508 var gamepad = SDL . getGamepad ( joystick - 1 ) ;
3509- if ( gamepad && gamepad . axes . length > axis ) {
3509+ if ( gamepad ? .axes . length > axis ) {
35103510 return SDL . joystickAxisValueConversion ( gamepad . axes [ axis ] ) ;
35113511 }
35123512 return 0 ;
@@ -3519,7 +3519,7 @@ var LibrarySDL = {
35193519 SDL_JoystickGetButton__proxy : 'sync' ,
35203520 SDL_JoystickGetButton : ( joystick , button ) = > {
35213521 var gamepad = SDL . getGamepad ( joystick - 1 ) ;
3522- if ( gamepad && gamepad . buttons . length > button ) {
3522+ if ( gamepad ? .buttons . length > button ) {
35233523 return SDL . getJoystickButtonState ( gamepad . buttons [ button ] ) ? 1 : 0 ;
35243524 }
35253525 return 0 ;
0 commit comments