diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-03-12 12:41:29 -0400 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-03-12 12:41:29 -0400 |
commit | cb11d841ecea5c55df6a73bff33eaac7cf477861 (patch) | |
tree | 8ba3b8293bd53369e7e2672e6bde4d1b1047b6ff /ai.c | |
parent | Fixed bug with data_potentialvps (diff) | |
download | 7w-cb11d841ecea5c55df6a73bff33eaac7cf477861.tar.gz 7w-cb11d841ecea5c55df6a73bff33eaac7cf477861.tar.bz2 7w-cb11d841ecea5c55df6a73bff33eaac7cf477861.zip |
Now cannot buy two of the same card
Diffstat (limited to 'ai.c')
-rw-r--r-- | ai.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -15,6 +15,7 @@ int weight_buildcard(int era, int card, int player); int weight_buildwonder(int player); int* cards_getproduction(int era, int card); int* cards_getcost(int era, int card); +int data_hasbuiltname(int p, int era, int card); int* ai_bestcard(int *hand, int player) //return card { @@ -23,7 +24,7 @@ int* ai_bestcard(int *hand, int player) //return card int card = 0; for(i = 0; hand[i] != -1 && i < 7; i++) { temp = weight_buildcard(data_getera(), hand[i], player); - if(! data_canafford(player, data_getera(), hand[i])) + if(! data_canafford(player, data_getera(), hand[i]) || data_hasbuiltname(player, data_getera(), hand[i])) temp = 0; if(temp > max) { max = temp; |