Fix rotating actors in the editor

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-10 21:06:58 -06:00
parent 6e7790efa6
commit e8d3adfe8e
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}
}
}

View File

@ -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