From 29c7fcaa7dcfdf793c8102d725e5dbd40219a305 Mon Sep 17 00:00:00 2001 From: Serg Date: Tue, 4 Feb 2020 22:47:22 -0500 Subject: [PATCH] Proposed fix for the issue with inconsistent type of 'properties' member of Tile Layer data. --- src/tilemaps/mapdata/LayerData.js | 4 ++-- src/tilemaps/parsers/tiled/ParseTileLayers.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tilemaps/mapdata/LayerData.js b/src/tilemaps/mapdata/LayerData.js index f000b90b2..31299eb78 100644 --- a/src/tilemaps/mapdata/LayerData.js +++ b/src/tilemaps/mapdata/LayerData.js @@ -149,10 +149,10 @@ var LayerData = new Class({ * Layer specific properties (can be specified in Tiled) * * @name Phaser.Tilemaps.LayerData#properties - * @type {object} + * @type {object[]} * @since 3.0.0 */ - this.properties = GetFastValue(config, 'properties', {}); + this.properties = GetFastValue(config, 'properties', []); /** * [description] diff --git a/src/tilemaps/parsers/tiled/ParseTileLayers.js b/src/tilemaps/parsers/tiled/ParseTileLayers.js index 6c96de68a..196c683c4 100644 --- a/src/tilemaps/parsers/tiled/ParseTileLayers.js +++ b/src/tilemaps/parsers/tiled/ParseTileLayers.js @@ -127,7 +127,7 @@ var ParseTileLayers = function (json, insertNull) tileHeight: json.tileheight, alpha: (curGroupState.opacity * curl.opacity), visible: (curGroupState.visible && curl.visible), - properties: GetFastValue(curl, 'properties', {}) + properties: GetFastValue(curl, 'properties', []) }); for (var c = 0; c < curl.height; c++) @@ -200,7 +200,7 @@ var ParseTileLayers = function (json, insertNull) tileHeight: json.tileheight, alpha: (curGroupState.opacity * curl.opacity), visible: (curGroupState.visible && curl.visible), - properties: GetFastValue(curl, 'properties', {}) + properties: GetFastValue(curl, 'properties', []) }); var row = [];