Happy0 / ssb-chess

A library for building scuttlebutt chess clients with
GNU General Public License v2.0
63 stars 16 forks source link

Error when castling #59

Closed bencevans closed 6 years ago

bencevans commented 6 years ago
Cannot read property 'role' of undefined
TypeError: Cannot read property 'role' of undefined
    at isPromotionMove (/home/bencevans/Code/patchbay/node_modules/ssb-chess/ui/game/gameView.js:52:37)
    at after (/home/bencevans/Code/patchbay/node_modules/ssb-chess/ui/game/gameView.js:127:17)
    at /home/bencevans/Code/patchbay/node_modules/chessground/board.js:11:43

This is happening on the most recent version of patchbay master https://github.com/ssbc/patchbay/commit/c6d3917a9dbbaf49b201e4e3964cb2e77346e9d3

Steps to reproduce:

  1. King and Rook in a position to castle
  2. Click King ... Green dots appear
  3. Click Rook... :boom: ... error page shows with above stacktrace
Happy0 commented 6 years ago

Interesting. When I castle I usually click the square next to the rook (the king's destination square.)

Your way should work though! I'll give it a try and see if I get the error :).

Thanks! .

Happy0 commented 6 years ago

Good steps to reproduce :D. I think that is the source of the issue.

I think I have a fix for it. I've invited you to a new game and I'll try it out once we get to a position where I can castle @bencevans :D.