From 95bd6391249b8ae366e4792fdb0997d963843d95 Mon Sep 17 00:00:00 2001 From: GRL Date: Tue, 29 Jun 2021 16:50:33 +0200 Subject: [PATCH] More statement --- front/src/Phaser/Game/GameMap.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/front/src/Phaser/Game/GameMap.ts b/front/src/Phaser/Game/GameMap.ts index aeb4cb62..f68c414a 100644 --- a/front/src/Phaser/Game/GameMap.ts +++ b/front/src/Phaser/Game/GameMap.ts @@ -183,7 +183,10 @@ export class GameMap { console.error("The layer that you want to change is not a tilelayer. Tile can only be put in tilelayer."); return; } - // @ts-ignore + if (typeof fLayer.data === "string") { + console.error("Data of the layer that you want to change is only readable."); + return; + } fLayer.data[x+y*fLayer.height] = index; } @@ -195,7 +198,7 @@ export class GameMap { this.putTileInFlatLayer(tileIndex, x, y, layer); const phaserTile = phaserLayer.putTileAt(tileIndex, x, y); for (const property of this.getTileProperty(tileIndex)) { - if ( property.name === "collides" ) { + if ( property.name === "collides" && property.value === "true") { phaserTile.setCollision(true); } }