From 1a39ccc3088dd3fbc6da9571a17060cc50f432e4 Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Wed, 11 Mar 2015 22:31:44 -0400 Subject: Squelched some bugs, more to go! --- player_turn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'player_turn.c') diff --git a/player_turn.c b/player_turn.c index bd9e805..a7d13d2 100644 --- a/player_turn.c +++ b/player_turn.c @@ -10,6 +10,9 @@ void data_discard(int p, int card); void data_buildwonder(int p, int card); void data_addgold(int amnt, int p); int data_numcards(int p); +int data_canafford(int p, int era, int card); +int data_getwonder(int p); +int data_getnextwonderstage(int p); int view_refresh(int focus, int cursor, int player); int wonder_numstages(int player); int* cards_getcost(int era, int card); @@ -28,7 +31,7 @@ int player_build(int focus, int cursor, int player) if(hand[cursor] == -1) return 0; int choice = postoptions(62, 20); if(choice == 0) { - if(data_canafford(player, cards_getcost(data_getera(), hand[cursor]))) { + if(data_canafford(player, data_getera(), hand[cursor])) { data_build(player, hand[cursor]); return 1; } @@ -38,10 +41,11 @@ int player_build(int focus, int cursor, int player) data_addgold(3, player); return 1; } else if(choice == 2) { - if(data_canafford(player, cards_getcost(data_getwonder(player), data_getwonderside(player)*3+1+cursor))) { + if(data_canafford(player, data_getwonder(player), data_getnextwonderstage(player))) { data_buildwonder(player, hand[cursor]); return 1; } + else postmessage("Can't afford this!"); } } return 0; -- cgit