Limit the undo stack to 200 tics

This commit is contained in:
Eevee (Evelyn Woods) committed 2020-09-03 13:55:19 -06:00
1 parent 8384b8d268
commit 25989fc75b
1 file changed
+5
+5
View File
@@ -700,6 +700,11 @@ class Level {
commit() { commit() {
this.undo_stack.push(this.pending_undo); this.undo_stack.push(this.pending_undo);
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() { undo() {