diff options
author | rodri <rgl@antares-labs.eu> | 2023-10-07 23:17:10 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-10-07 23:17:10 +0000 |
commit | 94fcdfff9e7a073fc15e71b111c728cdb6106520 (patch) | |
tree | 95058f6028da8c0344d64b1240751c196262080a | |
parent | 71c2cd61f6e53a455140f5920cff88cdfd4b4d33 (diff) | |
download | battleship-94fcdfff9e7a073fc15e71b111c728cdb6106520.tar.gz battleship-94fcdfff9e7a073fc15e71b111c728cdb6106520.tar.bz2 battleship-94fcdfff9e7a073fc15e71b111c728cdb6106520.zip |
only send a shot if the target cell is clear/unknown.
-rw-r--r-- | bts.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -643,8 +643,10 @@ lmb(Mousectl *mc) cell = toboard(&alienboard, mc->xy); /* TODO check if we already shot at that cell */ cell2coords(buf, sizeof buf, cell); - chanprint(egress, "shoot %s\n", buf); - lastshot = cell; + if(gettile(&alienboard, cell) == Twater){ + chanprint(egress, "shoot %s\n", buf); + lastshot = cell; + } break; } } |