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 --- trade.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'trade.c') 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 -- cgit