aboutsummaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'data.c')
-rw-r--r--data.c5
1 files changed, 2 insertions, 3 deletions
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;
}
bgstack15