Only traverse maneuvre stacks for drawing.

This commit is contained in:
Murilo Pereira 2011-05-01 02:05:35 -03:00
parent 0a37b5982a
commit 20d68a6f3d
2 changed files with 10 additions and 9 deletions

View File

@ -199,15 +199,16 @@ void draw_card(struct card *card) {
void draw_stack(struct stack *stack) {
if (!empty(stack)) {
struct stack *iterator = stack->next;
while (iterator != NULL) {
draw_card(iterator->card);
iterator = iterator->next;
}
draw_card(stack->card);
}
if (maneuvre_stack(stack)) {
struct stack *reversed_stack = reverse(stack);
return;
for (struct stack *i = reversed_stack; i; i = i->next) {
draw_card(i->card);
}
} else {
draw_card(stack->card);
}
}
}
void draw_deck(struct deck *deck) {

View File

@ -8,7 +8,7 @@
#include "util.h"
#include "game.h"
static bool maneuvre_stack(struct stack *stack) {
bool maneuvre_stack(struct stack *stack) {
return(stack->card->frame->start_y >= MANEUVRE_STACKS_STARTING_Y);
}