diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-03-19 17:47:35 -0400 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-03-19 17:47:35 -0400 |
commit | 6946460b7752ddd9b4f77ff4d28dbff9bda247b1 (patch) | |
tree | 8b1f0cb15e4163f2dd77deed3718dec50b908b2e /data.c | |
parent | Fixed bug causing trade to print incorrectly (diff) | |
download | 7w-6946460b7752ddd9b4f77ff4d28dbff9bda247b1.tar.gz 7w-6946460b7752ddd9b4f77ff4d28dbff9bda247b1.tar.bz2 7w-6946460b7752ddd9b4f77ff4d28dbff9bda247b1.zip |
ui and trading bug fixes
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -19,6 +19,7 @@ char* cards_getname(int wonder, int stage); void io_printborder(int x, int y, int width); int io_printtext(int xorigin, int y, int width, char* text); int io_getkey(); +int data_haswonderstage(int p, int wonder, int stage); #define MISC 3 #define DATAGOLD 0 @@ -314,6 +315,7 @@ void data_removedefinites(int p, int *cost) } } + int** data_getindefinites(int p) { int i, j, k, l, m, *prod; @@ -338,6 +340,22 @@ int** data_getindefinites(int p) } } } + if(data_haswonderstage(p, 4, 2) || data_haswonderstage(p, 4, 4)) { + m = 0; + prod = cards_getproduction(1, 12); //production for caravansery + for(l = 0; l < GOLD; l++) { + if(prod[l]) ret[k][m++] = l; + } + k++; + } + if(data_haswonderstage(p, 4, 5)) { + m = 0; + prod = cards_getproduction(1, 11); //production for forum + for(l = 0; l < GOLD; l++) { + if(prod[l]) ret[k][m++] = l; + } + k++; + } return ret; } @@ -348,7 +366,7 @@ int* data_gettradables(int p) for(i = 0; i < GOLD+1; i++) ret[i] = 0; for(i = 0; i < 3; i++) { for(j = 0; j < 7; j++) { - if(player[p][i][j] != -1) { + if(player[p][i][j] != -1 && (cards_gettype(i, player[p][i][j]) == RESOURCE || cards_gettype(i, player[p][i][j]) == INDUSTRY)) { prod = cards_getproduction(i, player[p][i][j]); for(k = 0; k < GOLD; k++) { ret[k] += prod[k]; |