Clear later checkpoints

This commit is contained in:
Grant Sanderson 2022-05-01 15:31:42 -04:00
parent 602fbd1a9f
commit 4a8e8e5447

View file

@ -754,6 +754,11 @@ class Scene(object):
if key not in self.checkpoint_states:
log.error(f"No checkpoint at {key}")
return
all_keys = list(self.checkpoint_states.keys())
index = all_keys.index(key)
for later_key in all_keys[index + 1:]:
self.checkpoint_states.pop(later_key)
self.restore_state(self.checkpoint_states[key])
def clear_checkpoints(self):