From 25989fc75b77bca47b575c01fcc8097b1fdc51cd Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Thu, 3 Sep 2020 13:54:14 -0600 Subject: [PATCH] Limit the undo stack to 200 tics --- js/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/main.js b/js/main.js index a38ce07..ac87175 100644 --- a/js/main.js +++ b/js/main.js @@ -700,6 +700,11 @@ class Level { commit() { this.undo_stack.push(this.pending_undo); this.pending_undo = []; + + // Limit the stack to, idk, 200 tics (10 seconds) + if (this.undo_stack.length > 200) { + this.undo_stack.splice(0, this.undo_stack.length - 200); + } } undo() {