diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-02-24 15:24:39 -0500 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-02-24 15:24:39 -0500 |
commit | 952244e7b184bf88122742ad75b884d1eb97eae5 (patch) | |
tree | 0ada6a0b2b200b9e4af7f0c745e25c9fd42b3f3c /data.c | |
parent | Added more support for idefinites, but has major bugs! (diff) | |
download | 7w-952244e7b184bf88122742ad75b884d1eb97eae5.tar.gz 7w-952244e7b184bf88122742ad75b884d1eb97eae5.tar.bz2 7w-952244e7b184bf88122742ad75b884d1eb97eae5.zip |
Added messages, fixed indefinites
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -184,6 +184,7 @@ int* data_getdefinites(int p) { int *ret = get_intarray(GOLD); int i, j, k, *prod; + for(i = 0; i < GOLD; i++) ret[i] = 0; for(i = 0; i < 3; i++) { for(j = 0; j < 7; j++) { if(data_productiontype(i, player[p][i][j]) == 1) { @@ -257,13 +258,12 @@ static int recurse(int *cost, int **indef, int c) return 0; } -//return 0 if can't afford, 1 if must buy stuff from neighbors, 2 if have all resources. int data_canafford(int p, int *cost) { if(cost[GOLD] > player[p][MISC][DATAGOLD]) return 0; int i, j, k; data_removedefinites(p, cost); - if(data_iszerocost(cost)) return 2; + if(data_iszerocost(cost)) return 1; return recurse(cost, data_getindefinites(p), 0); } |