diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-04-18 20:32:49 -0400 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-04-18 20:32:49 -0400 |
commit | 8458fbece94f2253664fe23324c54374aa2a69e3 (patch) | |
tree | 5ce6125caf895a1d73ecd569b15d74e4e311d549 /data.c | |
parent | Restructured end of turn (diff) | |
download | 7w-8458fbece94f2253664fe23324c54374aa2a69e3.tar.gz 7w-8458fbece94f2253664fe23324c54374aa2a69e3.tar.bz2 7w-8458fbece94f2253664fe23324c54374aa2a69e3.zip |
Fixed bug with spending more gold than in treasury
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; } |