From 952244e7b184bf88122742ad75b884d1eb97eae5 Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Tue, 24 Feb 2015 15:24:39 -0500 Subject: Added messages, fixed indefinites --- data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data.c') 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); } -- cgit