mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix the states replay loop
Signed-off-by:Guillaume Martigny <guillaume.martigny@gmail.com>
This commit is contained in:
parent
eb1320de11
commit
0f00ef563a
@ -175,12 +175,14 @@
|
||||
this.piskelController.setPiskel(piskel);
|
||||
|
||||
var walkingIndex = snapshotIndex;
|
||||
do{
|
||||
while(walkingIndex && walkingIndex != index){
|
||||
walkingIndex = this.stateQueue[walkingIndex].nextIndex;
|
||||
var state = this.stateQueue[walkingIndex];
|
||||
this.setupState(state);
|
||||
this.replayState(state);
|
||||
} while(walkingIndex && walkingIndex != index);
|
||||
if(walkingIndex){
|
||||
var state = this.stateQueue[walkingIndex];
|
||||
this.setupState(state);
|
||||
this.replayState(state);
|
||||
}
|
||||
}
|
||||
|
||||
// Should only do this when going backwards
|
||||
var next = this.stateQueue[index].nextIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user