Limit the undo stack to 200 tics
This commit is contained in:
parent
8384b8d268
commit
25989fc75b
@ -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() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user