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 /trade.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 'trade.c')
-rw-r--r-- | trade.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |