X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;h=c0dc826fd0ae9d5661991224251cd1b944f73c18;hb=01a135e2aa21365c0a96931fbb6be76876e7c2a1;hp=7f4052ac9b97beed213798001baa9c925a33554f;hpb=ffbae57a25ae8e376959bfc91095bb6ab97230e0;p=vchess.git
diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js
index 7f4052ac..c0dc826f 100644
--- a/public/javascripts/base_rules.js
+++ b/public/javascripts/base_rules.js
@@ -712,7 +712,7 @@ class ChessRules
VariantRules.PlayOnBoard(this.board, move);
}
- undo(move, ingame)
+ undo(move)
{
VariantRules.UndoOnBoard(this.board, move);
this.epSquares.pop();
@@ -1037,14 +1037,15 @@ class ChessRules
}
// The score is already computed when calling this function
- getPGN(mycolor, score, fenStart)
+ getPGN(mycolor, score, fenStart, mode)
{
let pgn = "";
pgn += '[Site "vchess.club"]
';
const d = new Date();
+ const opponent = this.mode=="human" ? "Anonymous" : "Computer";
pgn += '[Date "' + d.getFullYear() + '-' + d.getMonth() + '-' + d.getDate() + '"]
';
- pgn += '[White "' + (mycolor=='w'?'Myself':'Anonymous') + '"]
';
- pgn += '[Black "' + (mycolor=='b'?'Myself':'Anonymous') + '"]
';
+ pgn += '[White "' + (mycolor=='w'?'Myself':opponent) + '"]
';
+ pgn += '[Black "' + (mycolor=='b'?'Myself':opponent) + '"]
';
pgn += '[Fen "' + fenStart + '"]
';
pgn += '[Result "' + score + '"]
';