Skip to content

Commit db2fdc1

Browse files
committed
Update GetTileAt.js
1 parent f130f5e commit db2fdc1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/tilemaps/components/GetTileAt.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ var IsInLayerBounds = require('./IsInLayerBounds');
1717
* @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1.
1818
* @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.
1919
*
20-
* @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates
21-
* were invalid.
20+
* @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid.
2221
*/
2322
var GetTileAt = function (tileX, tileY, nonNull, layer)
2423
{
@@ -27,7 +26,8 @@ var GetTileAt = function (tileX, tileY, nonNull, layer)
2726
if (IsInLayerBounds(tileX, tileY, layer))
2827
{
2928
var tile = layer.data[tileY][tileX] || null;
30-
if (tile === null)
29+
30+
if (!tile)
3131
{
3232
return null;
3333
}

0 commit comments

Comments
 (0)