Merge pull request #2304 from cy-ryo-fujiwara/bug-map-hastile

Fixed a bug of tilemap.hasTile
This commit is contained in:
Richard Davey 2016-02-01 18:10:09 +02:00
commit dd02f0b482

View file

@ -1219,9 +1219,10 @@ Phaser.Tilemap.prototype = {
hasTile: function (x, y, layer) { hasTile: function (x, y, layer) {
layer = this.getLayer(layer); layer = this.getLayer(layer);
if (this.layers[layer].data[y] === undefined || this.layers[layer].data[y][x] === undefined) {
return false;
}
return (this.layers[layer].data[y][x].index > -1); return (this.layers[layer].data[y][x].index > -1);
}, },
/** /**