fix undefined gamepad
when script.clear
gets called
#1621
Merged
gamepad
when script.clear
gets called
#1621