aboutsummaryrefslogtreecommitdiff
path: root/player_turn.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-03-12 12:41:29 -0400
committerNathan Vance <nathav63@gmail.com>2015-03-12 12:41:29 -0400
commitcb11d841ecea5c55df6a73bff33eaac7cf477861 (patch)
tree8ba3b8293bd53369e7e2672e6bde4d1b1047b6ff /player_turn.c
parentFixed bug with data_potentialvps (diff)
download7w-cb11d841ecea5c55df6a73bff33eaac7cf477861.tar.gz
7w-cb11d841ecea5c55df6a73bff33eaac7cf477861.tar.bz2
7w-cb11d841ecea5c55df6a73bff33eaac7cf477861.zip
Now cannot buy two of the same card
Diffstat (limited to 'player_turn.c')
-rw-r--r--player_turn.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/player_turn.c b/player_turn.c
index aa86077..891c565 100644
--- a/player_turn.c
+++ b/player_turn.c
@@ -13,6 +13,7 @@ int data_numcards(int p);
int data_canafford(int p, int era, int card);
int data_getwonder(int p);
int data_getnextwonderstage(int p);
+int data_hasbuiltname(int p, int era, int card);
int view_refresh(int focus, int cursor, int player);
int wonder_numstages(int player);
int* cards_getcost(int era, int card);
@@ -31,6 +32,10 @@ int player_build(int focus, int cursor, int player)
if(hand[cursor] == -1) return 0;
int choice = postoptions(62, 20);
if(choice == 0) {
+ if(data_hasbuiltname(player, data_getera(), hand[cursor])) {
+ postmessage("Cannot have two of the same card!");
+ return 0;
+ }
if(data_canafford(player, data_getera(), hand[cursor])) {
data_build(player, hand[cursor]);
return 1;
bgstack15