Skip to content

Commit dd02f0b

Browse files
committed
Merge pull request phaserjs#2304 from cy-ryo-fujiwara/bug-map-hastile
Fixed a bug of tilemap.hasTile
2 parents 0942ad9 + b75d6c4 commit dd02f0b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/tilemap/Tilemap.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,9 +1219,10 @@ Phaser.Tilemap.prototype = {
12191219
hasTile: function (x, y, layer) {
12201220

12211221
layer = this.getLayer(layer);
1222-
1222+
if (this.layers[layer].data[y] === undefined || this.layers[layer].data[y][x] === undefined) {
1223+
return false;
1224+
}
12231225
return (this.layers[layer].data[y][x].index > -1);
1224-
12251226
},
12261227

12271228
/**

0 commit comments

Comments
 (0)