aboutsummaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-24 15:24:39 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-24 15:24:39 -0500
commit952244e7b184bf88122742ad75b884d1eb97eae5 (patch)
tree0ada6a0b2b200b9e4af7f0c745e25c9fd42b3f3c /data.c
parentAdded more support for idefinites, but has major bugs! (diff)
download7w-952244e7b184bf88122742ad75b884d1eb97eae5.tar.gz
7w-952244e7b184bf88122742ad75b884d1eb97eae5.tar.bz2
7w-952244e7b184bf88122742ad75b884d1eb97eae5.zip
Added messages, fixed indefinites
Diffstat (limited to 'data.c')
-rw-r--r--data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/data.c b/data.c
index 656c80a..f164b74 100644
--- a/data.c
+++ b/data.c
@@ -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);
}
bgstack15