fixes bug when no state has be save yet
parent
ff893396fe
commit
232a4e9936
|
|
@ -133,7 +133,7 @@ public class Game {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copys the current move list to the savestate
|
* Copies the current move list to the savestate
|
||||||
*/
|
*/
|
||||||
public void quicksave() {
|
public void quicksave() {
|
||||||
// TODO: save the current clocktime
|
// TODO: save the current clocktime
|
||||||
|
|
@ -148,14 +148,17 @@ public class Game {
|
||||||
* from the savestate
|
* from the savestate
|
||||||
*/
|
*/
|
||||||
public void quickload() {
|
public void quickload() {
|
||||||
this.board = new Board();
|
if (this.savestate != null) {
|
||||||
this.board.loadFromFen(startPosFen);
|
|
||||||
|
|
||||||
for (Move move : savestate) {
|
this.board = new Board();
|
||||||
this.playMove(move);
|
this.board.loadFromFen(startPosFen);
|
||||||
|
|
||||||
|
for (Move move : savestate) {
|
||||||
|
this.playMove(move);
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("Quickloaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Quickloaded");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue