From 0fde3a0bac550e4739757f1f60d0eb566b4007a1 Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Sun, 19 Apr 2015 17:32:49 -0400 Subject: UI bug fixes --- data.c | 3 ++- trade.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/data.c b/data.c index f9a8ba6..29be94d 100644 --- a/data.c +++ b/data.c @@ -147,7 +147,8 @@ void data_endturn() if(totturns == 6) { for(i = 0; i < numplayers; i++) { if(data_getwonder(i) == 6 && data_getwonderside(i)*3+data_getwonderstages(i) >= 5) { - player_turn(i); + if(data_isai(i)) ai_turn(i); + else player_turn(i); data_flushbuffers(); } else data_discard((i+numplayers-turn)%numplayers, hands[i][0]); } diff --git a/trade.c b/trade.c index d916395..94ecdb5 100644 --- a/trade.c +++ b/trade.c @@ -110,10 +110,15 @@ void trade_print(int x, int y, int player, int cursorx, int cursory) for(i = 0; i < GOLD+1; i++) { sprintf(s, "%-7s%2d %c| %-7s %d %c", getname(i), west[i], (cursorx == 1 && cursory == i)? '*' : ' ', getname(i), east[i], (cursorx == 0 && cursory == i)? '*' : ' '); y = io_printtext(x, y, width, s); - if(tradebuffer[1][i]) - io_printcolor(x+10, y-1, 31, itoa(west[i])); - if(tradebuffer[0][i]) + if(tradebuffer[1][i]) { + if(west[i] < 10) + io_printcolor(x+10, y-1, 31, itoa(west[i])); + else + io_printcolor(x+9, y-1, 31, itoa(west[i])); + } + if(tradebuffer[0][i]) { io_printcolor(x+23, y-1, 31, itoa(east[i])); + } } sprintf(s, "Your gold: %d", data_getgold(player)); y = io_printtext(x, y, width, s); -- cgit