Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug of tilemap.hasTile #2304

Merged
merged 1 commit into from
Feb 1, 2016

Conversation

bv-ryo-fujiwara
Copy link
Contributor

map.hasTile() bug.
"Uncaught TypeError: Cannot read property '1' of undefined"

false if there is not a tile at the given location. but has error.

example:

game.physics.startSystem(Phaser.Physics.ARCADE);
map = game.add.tilemap('XXXX');
map.addTilesetImage('YYY', 'ZZZ');

console.log(map.width);              // output: 40
console.log(map.height);             // output: 40

// true
console.log(map.hasTile(0,0));       // output: true
console.log(map.hasTile(1,39));      // output: true
console.log(map.hasTile(39,0));      // output: true
// Error!!
console.log(map.hasTile(1, 40));     // output: Uncaught TypeError: Cannot read property '1' of undefined

@bv-ryo-fujiwara bv-ryo-fujiwara changed the title Fixed a bug of map.hasTile Fixed a bug of tilemap.hasTile Jan 19, 2016
@photonstorm
Copy link
Collaborator

Looks good to me.

photonstorm added a commit that referenced this pull request Feb 1, 2016
@photonstorm photonstorm merged commit dd02f0b into phaserjs:dev Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants