Skip to content

Commit 2d4d1a0

Browse files
committed
Tilemap.hasTile now checks the Tile.index value and will return false if the index is -1 (i.e. a non-active tile) (thanks @elgansayer phaserjs#859)
1 parent a7d9b2c commit 2d4d1a0

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Version 2.1.0 - "Cairhien" - -in development-
130130
* InputHandler docs updated to avoid Pointer data-type confusion (#1097)
131131
* If you used a single Game configuration object and didn't specify the enableDebug property it would crash on Debug.preUpdate (thanks @luizbills #1053)
132132
* The P2.World.postBroadphaseHandler now checks if the returned pairs array is empty or not before processing it (thanks @wayfu #934)
133+
* Tilemap.hasTile now checks the Tile.index value and will return false if the index is -1 (i.e. a non-active tile) (thanks @elgansayer #859)
133134

134135
### p2.js 0.6.0 Changes and New Features
135136

src/tilemap/Tilemap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ Phaser.Tilemap.prototype = {
10841084

10851085
layer = this.getLayer(layer);
10861086

1087-
return (this.layers[layer].data[y] !== null && this.layers[layer].data[y][x] !== null);
1087+
return (this.layers[layer].data[y][x].index > -1);
10881088

10891089
},
10901090

0 commit comments

Comments
 (0)