Make end turn button appear in the right place

This commit is contained in:
Anna Rose 2011-07-04 01:40:02 -04:00
parent 79740d3cee
commit 67cbd43740

View File

@ -151,14 +151,17 @@ void Game::render()
DrawUtils::draw_line(display, 150, display->h - 100, 150, display->h, 2, DrawUtils::draw_line(display, 150, display->h - 100, 150, display->h, 2,
0x000000); 0x000000);
if (data.get_current_vertex() != NULL &&
data.get_current_vertex()->player == data.get_turn())
{ {
for (list<MenuButton*>::iterator cursor = buttons.begin(); for (list<MenuButton*>::iterator cursor = buttons.begin();
cursor != buttons.end(); cursor++) cursor != buttons.end(); cursor++)
{ {
MenuButton* button = *cursor; MenuButton* button = *cursor;
if (!(button->get_action() & BUTTON_END_TURN) &&
(data.get_current_vertex() == NULL ||
data.get_current_vertex()->player != data.get_turn()))
continue;
if ((button->get_action() & (BUTTON_BUILD_ATTACKER | if ((button->get_action() & (BUTTON_BUILD_ATTACKER |
BUTTON_BUILD_DEFENDER | BUTTON_BUILD_DEFENDER |
BUTTON_BUILD_PRODUCER)) && BUTTON_BUILD_PRODUCER)) &&