shithub: battleship

Download patch

ref: 118df45d3740cc6a391e181e60aeaef7571c5e0b
parent: 230cd15dfa5fc602639f0d55080ae2ff8794c5ba
author: rodri <rgl@antares-labs.eu>
date: Sun Sep 10 14:56:15 EDT 2023

fixed game-breaking typo.

--- a/btsd.c
+++ b/btsd.c
@@ -177,7 +177,7 @@
 					settile(op, cell, Thit);
 					write(p->fd, "hit\n", 4);
 					fprint(op->fd, "hit %s\n", cell2coords(cell));
-					if(countshipcells(op) < 17){
+					if((debug && countshipcells(op) < 17) || (!debug && countshipcells(op) < 1)){
 						write(p->fd, "win\n", 4);
 						write(op->fd, "lose\n", 5);
 						sendp(playerq, p);