From b4acc74e0af93ad88f7629e47f7c1edb98d542b0 Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Sun, 10 Jan 2021 14:44:23 -0700 Subject: [PATCH] Explicitly allow VFX to erase other VFX (otherwise undo breaks!) --- js/game.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/game.js b/js/game.js index 80ababf..fc77e51 100644 --- a/js/game.js +++ b/js/game.js @@ -2279,6 +2279,13 @@ export class Level extends LevelInterface { spawn_animation(cell, name) { let type = TILE_TYPES[name]; + // Spawned VFX erase any existing VFX + if (type.layer === LAYERS.vfx) { + let vfx = cell[type.layer]; + if (vfx) { + this.remove_tile(vfx); + } + } let tile = new Tile(type); // Co-opt movement_cooldown/speed for these despite that they aren't moving, since those // properties are also used to animate everything else anyway. Decrement the cooldown