Fix bug that did not delete the pawn taken by enPassant.

This commit is contained in:
Marco 2023-08-15 00:37:18 +02:00
parent 9fbffc61f9
commit 72faedc000
2 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,8 @@ func (p *Pawn) HandleEnPassant(b *Board, move, lastMove types.Move) (bool, error
}
if wasEnPassant { //play the move
delete(b.position, lastMove.EndSquare)
delete(b.position, lastMove.EndSquare) // take opponent's pawn
delete(b.position, move.StartSquare) // move moving pawn
b.position[move.EndSquare] = GetPieceForShortName(move.PieceMoved)
}

View File

@ -88,7 +88,6 @@ func hostPrivateGame(c *gin.Context) {
func joinPrivateGame(c *gin.Context) {
req := api.PlayerInfo{}
log.Println("OI, WHERES ME LOGS")
log.Println(c.Request.Body)
err := c.ShouldBindJSON(&req)
if err != nil || req.Passphrase == nil || *req.Passphrase == "" {