From 1a39ccc3088dd3fbc6da9571a17060cc50f432e4 Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Wed, 11 Mar 2015 22:31:44 -0400 Subject: Squelched some bugs, more to go! --- ai_weights.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ai_weights.c') diff --git a/ai_weights.c b/ai_weights.c index b56fe70..bd7cd0c 100644 --- a/ai_weights.c +++ b/ai_weights.c @@ -3,12 +3,14 @@ int data_getdir(int dir, int p); //0 is east, 1 is west, 2 returns player int* cards_getproduction(int era, int card); int* cards_getcost(int era, int card); -int data_canafford(int p, int *cost); +int data_canafford(int p, int era, int card); int* data_getdefinites(int p); int** data_getindefinites(int p); int* data_gettradables(int p); int data_productiontype(int e, int card); int data_getwonderstages(int p); +int data_getwonder(int p); +int data_getnextwonderstage(int p); int* get_special(int era, int card, int player); int get_trade(int player, int type, int direction); int cards_gettype(int era, int card); @@ -123,5 +125,6 @@ int weight_buildcard(int era, int card, int player) int weight_buildwonder(int player) { + if(! data_canafford(player, data_getwonder(player), data_getnextwonderstage(player))) return 0; return (data_getwonderstages(player)+2) * 2; } -- cgit