Fix rotating actors in the editor
This commit is contained in:
parent
6e7790efa6
commit
e8d3adfe8e
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user