diff --git a/js/main.js b/js/main.js index 88cec84..dd79448 100644 --- a/js/main.js +++ b/js/main.js @@ -683,8 +683,6 @@ const EDITOR_TOOLS = [{ }]; // Tiles the "adjust" tool will turn into each other const EDITOR_ADJUST_TOGGLES = { - floor: 'wall', - wall: 'floor', floor_custom_green: 'wall_custom_green', floor_custom_pink: 'wall_custom_pink', floor_custom_yellow: 'wall_custom_yellow', @@ -795,7 +793,7 @@ class Editor extends PrimaryView { // Rotate actors if (TILE_TYPES[tile.name].is_actor) { - tile.direction = DIRECTIONS[tile.direction].right; + tile.direction = DIRECTIONS[tile.direction ?? 'south'].right; } } } diff --git a/js/renderer-canvas.js b/js/renderer-canvas.js index bec7183..9eadf94 100644 --- a/js/renderer-canvas.js +++ b/js/renderer-canvas.js @@ -96,6 +96,7 @@ export class CanvasRenderer { for (let tile of this.level.cells[y][x]) { let type; if (tile.name) { + // FIXME editor hack type = TILE_TYPES[tile.name]; } else { @@ -106,7 +107,8 @@ export class CanvasRenderer { continue; if (! tile.type) { - this.tileset.draw_type(tile.name, null, this.level, ctx, x - x0, y - y0); + // FIXME not a real tile, really not ideal, editor hack + this.tileset.draw_type(tile.name, tile, this.level, ctx, x - x0, y - y0); } else if (type.is_actor) { // Handle smooth scrolling