diff --git a/js/game.js b/js/game.js index ebd989d..6041e22 100644 --- a/js/game.js +++ b/js/game.js @@ -2455,6 +2455,28 @@ export class Level extends LevelInterface { } this._do_extra_cooldown(tile); } + + //update static_on_tic_tiles + //TODO: if which on_tic happens first ever matters, this will introduce a time travel bug where the order is changed by changing tiles then undoing that. hmm + if (old_type.on_tic && !new_type.on_tic) + { + //search array and remove + for (let i = 0; i < this.static_on_tic_tiles.length; ++i) + { + if (this.static_on_tic_tiles[i] == tile) + { + this.static_on_tic_tiles.splice(i, 1); + break; + } + } + } + else if (!old_type.on_tic && new_type.on_tic) + { + //add to end of array + this.static_on_tic_tiles.push(tile); + } + + //TODO: update circuit networks? } // Have an actor try to pick up a particular tile; it's prevented if there's a no sign, and the