summary refs log tree commit diff
path: root/sol.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sol.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sol.c b/sol.c
index 1933716..b4a323f 100644
--- a/sol.c
+++ b/sol.c
@@ -117,7 +117,7 @@ static bool gameAvail(Card card) {
 	if (card < 0) return false;
 	if (!gameFind(&stack, &index, card)) return false;
 
-	bool top = (index == stacks[stack].len - 1);
+	bool top = (card == stackTop(&stacks[stack]));
 	if (stack == Waste1) {
 		return top && !stacks[Waste3].len;
 	} else if (stack == Waste3) {
@@ -135,7 +135,7 @@ static bool gameReveal(Card card) {
 	uint stack, index;
 	if (!gameFind(&stack, &index, card)) return false;
 	if (stack < Tableau1 || stack > Tableau7) return false;
-	if (index != stacks[stack].len - 1) return false;
+	if (card != stackTop(&stacks[stack])) return false;
 	if (card > 0) return false;
 	gameDo(stackFlipTo, stack, stack, 1);
 	return true;
@@ -247,7 +247,8 @@ static void layoutCard(struct List **list, SDL_Rect *rect, Card card) {
 		*list = &layout.drag;
 		*rect = layout.dragItem.rect;
 	}
-	struct Item item = { *rect, (card > 0 ? card : layout.backTexture), card };
+	uint texture = (card > 0 ? (uint)card : layout.backTexture);
+	struct Item item = { *rect, texture, card };
 	listPush(*list, item);
 }
 
error messagesJune McEnroe 2019-10-27Add reload cmd to rc scriptJune McEnroe 2019-10-27Reload certificate on SIGUSR1June McEnroe 2019-10-27Drop clients on zero-length readsJune McEnroe 2019-10-27Explicitly tls_handshake new clientsJune McEnroe 2019-10-26Document rationaleJune McEnroe 2019-10-26Handle nick collisionJune McEnroe 2019-10-26Wait for AUTHENTICATE + from serverJune McEnroe 2019-10-26Respond to PING with same parameterJune McEnroe 2019-10-26Add undocumented flag to disable verificationJune McEnroe 2019-10-26Do not require RPL_ISUPPORT for stateReadyJune McEnroe 2019-10-26Implement graceful shutdownJune McEnroe 2019-10-26Require PASS before USERJune McEnroe 2019-10-26Track channel topicsJune McEnroe 2019-10-26Set AWAY when no clients are connectedJune McEnroe 2019-10-26Add flags to request TOPIC and NAMES on client connectJune McEnroe 2019-10-26OopsJune McEnroe 2019-10-26Disconnect client on unknown commandJune McEnroe 2019-10-26Allow reading sensitive information from filesJune McEnroe 2019-10-26Add rc scriptJune McEnroe 2019-10-25Add install and uninstall targetsJune McEnroe 2019-10-25Expand documentationJune McEnroe 2019-10-25Add AGPLv3 notice on client registrationJune McEnroe 2019-10-25Rename project pounceJune McEnroe