phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

Gampad Unplug Error "timestamp" #610

Closed Weedshaker closed 5 years ago

Weedshaker commented 5 years ago

Phaser version(s): Phaser CE v2.11.1 What steps produce the bug: Unplug Gamepad while game is running What should happen: No Error What happens instead: Uncaught TypeError: Cannot read property 'timestamp' of undefined

Weedshaker commented 5 years ago

its certainly at: https://github.com/photonstorm/phaser-ce/blob/04204f5180af319e3abdc895190543a9f9f9b7f3/src/input/SinglePad.js

Line: 176

if (!this.connected || !this.game.input.enabled || !this.game.input.gamepad.enabled || (this._rawPad.timestamp && (this._rawPad.timestamp === this._prevTimestamp)))