Skip to content

Commit be3edd8

Browse files
committed
Now the backwards compatibility is not broken
As implementation is leaning on 0.11.0 feature of Tiled, I made sure the earlier Tiled files that might be used are not going to break from this. Defaulting to empty string if the .type property is not defined by Tiled (for Tiled < 0.11.0), otherwise we use the provided value.
1 parent 8a197b6 commit be3edd8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/tilemap/TilemapParser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ Phaser.TilemapParser = {
448448

449449
gid: json.layers[i].objects[v].gid,
450450
name: json.layers[i].objects[v].name,
451-
type: json.layers[i].objects[v].type,
451+
type: json.layers[i].objects[v].hasOwnProperty("type") ? json.layers[i].objects[v].type : "",
452452
x: json.layers[i].objects[v].x,
453453
y: json.layers[i].objects[v].y,
454454
visible: json.layers[i].objects[v].visible,

0 commit comments

Comments
 (0)