From 8458fbece94f2253664fe23324c54374aa2a69e3 Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Sat, 18 Apr 2015 20:32:49 -0400 Subject: Fixed bug with spending more gold than in treasury --- data.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'data.c') diff --git a/data.c b/data.c index f631e3e..f9a8ba6 100644 --- a/data.c +++ b/data.c @@ -570,15 +570,14 @@ int data_iscouponed(int p, int era, int card) int data_canafford(int p, int era, int card) { - int ret; if(data_iscouponed(p, era, card)) return 1; int *cost = cards_getcost(era, card); + if(cost[GOLD] > data_getgold(p) && p != hasfreebuild) return 0; int i, j, k; data_removedefinites(p, cost); data_removetraded(p, cost); if(data_iszerocost(cost)) return 1; - ret = recurse(cost, data_getindefinites(p), 0) && (cost[GOLD] <= data_getgold(p)); - if(ret) return 1; + if(recurse(cost, data_getindefinites(p), 0)) return 1; if(p == hasfreebuild) return 2; return 0; } -- cgit