aboutsummaryrefslogtreecommitdiff
path: root/trade.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-04-18 20:32:49 -0400
committerNathan Vance <nathav63@gmail.com>2015-04-18 20:32:49 -0400
commit8458fbece94f2253664fe23324c54374aa2a69e3 (patch)
tree5ce6125caf895a1d73ecd569b15d74e4e311d549 /trade.c
parentRestructured end of turn (diff)
download7w-8458fbece94f2253664fe23324c54374aa2a69e3.tar.gz
7w-8458fbece94f2253664fe23324c54374aa2a69e3.tar.bz2
7w-8458fbece94f2253664fe23324c54374aa2a69e3.zip
Fixed bug with spending more gold than in treasury
Diffstat (limited to 'trade.c')
-rw-r--r--trade.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/trade.c b/trade.c
index 1a187b1..d916395 100644
--- a/trade.c
+++ b/trade.c
@@ -54,12 +54,15 @@ void trade_clear(int player)
void trade_set(int player, int trade[3][GOLD])
{
int i, j;
- for(i = 0; i < 3; i++) {
+ for(i = 0; i < 3; i++)
+ tradebuffer[i][GOLD] = 0; //we deal with gold in the method that calls this
+ for(i = 0; i < 2; i++) {
for(j = 0; j < GOLD; j++) {
- tradebuffer[i][j] = trade[i][j];
+ tradebuffer[i][j] = trade[i][j] * -1;
}
- tradebuffer[i][GOLD] = 0; //we deal with gold in the method that calls this
}
+ for(j = 0; j < GOLD; j++)
+ tradebuffer[2][j] = trade[2][j];
}
//gold amounts relative to player
bgstack15