aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-09-15 23:06:58 +0000
committerrodri <rgl@antares-labs.eu>2023-09-15 23:06:58 +0000
commite59ffbe6921ccea4d8039082d6d093568edfa08d (patch)
treefc1b960c267682db2d67a859121c7d1736452591
parent48fe28aa56b83af341957b472c023a667639776c (diff)
downloadbattleship-e59ffbe6921ccea4d8039082d6d093568edfa08d.tar.gz
battleship-e59ffbe6921ccea4d8039082d6d093568edfa08d.tar.bz2
battleship-e59ffbe6921ccea4d8039082d6d093568edfa08d.zip
don't send shots when the game is over. and freeze the cursor.
-rw-r--r--bts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bts.c b/bts.c
index 85b8459..8d37354 100644
--- a/bts.c
+++ b/bts.c
@@ -509,7 +509,7 @@ lmb(Mousectl *mc)
else if(ptinrect(mc->xy, localboard.bbox))
b = &localboard;
- if(b == nil)
+ if(b == nil || conclusion.s != nil)
return;
cell = toboard(b, mc->xy);
@@ -639,7 +639,7 @@ mouse(Mousectl *mc)
}
}
- if(game.state == Playing)
+ if(game.state == Playing && conclusion.s == nil)
if(ptinrect(mc->xy, alienboard.bbox))
csetcursor(mctl, &aimcursor);
else