Fix the states replay loop

Signed-off-by:Guillaume Martigny <guillaume.martigny@gmail.com>
This commit is contained in:
Guillaume Martigny 2016-04-19 16:45:55 +02:00 committed by Julian Descottes
parent eb1320de11
commit 0f00ef563a

View File

@ -175,12 +175,14 @@
this.piskelController.setPiskel(piskel);
var walkingIndex = snapshotIndex;
do{
while(walkingIndex && walkingIndex != index){
walkingIndex = this.stateQueue[walkingIndex].nextIndex;
if(walkingIndex){
var state = this.stateQueue[walkingIndex];
this.setupState(state);
this.replayState(state);
} while(walkingIndex && walkingIndex != index);
}
}
// Should only do this when going backwards
var next = this.stateQueue[index].nextIndex;