jakesylvestre / pychess

Automatically exported from code.google.com/p/pychess
GNU General Public License v3.0
1 stars 7 forks source link

Wrong name of the piece promoted in comment panel #643

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In chess game the piece promoted is correct, but the comments side panel is a 
wrong name. The correct code below:

Modify  /lib/pychess/Utils/lutils/strateval.py  diff

  flag = FLAG(model.getMoveAtPly(ply-1).move)
  if flag in PROMOTIONS:
-    yield _("promotes a Pawn to a %s") % reprPiece[flag-2]
+    yield _("promotes a Pawn to a %s") % reprPiece[flag-3]

  elif flag in (KING_CASTLE, QUEEN_CASTLE):
     yield _("castles")

Original issue reported on code.google.com by leogregianin@gmail.com on 30 Jan 2011 at 4:32

GoogleCodeExporter commented 9 years ago
Ohh no, correct is "reprPiece[flag-2]".

Original comment by leogregianin@gmail.com on 30 Jan 2011 at 4:34

GoogleCodeExporter commented 9 years ago
Best is "reprPiece[PROMOTE_PIECE(flag)]", which removes all doubt. :D

Original comment by Uncombed...@gmail.com on 9 Mar 2011 at 7:34

GoogleCodeExporter commented 9 years ago
Lovely.
It's in.

Original comment by lobais on 9 Mar 2011 at 8:34