X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;h=c0dc826fd0ae9d5661991224251cd1b944f73c18;hp=11de1471fa398a5dc912f8a5fd80d67a01e05702;hb=01a135e2aa21365c0a96931fbb6be76876e7c2a1;hpb=cd4cad0468612cf00c6e6879554e3cee58d4b1f9
diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js
index 11de1471..c0dc826f 100644
--- a/public/javascripts/base_rules.js
+++ b/public/javascripts/base_rules.js
@@ -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 + '"]
';